~tardypad/tardypad.me

ref: 3583bee9b3712202a330f02844308a8b2d9e280b tardypad.me/check/Makefile -rw-r--r-- 910 bytes
3583bee9Damien Tardy-Panis carl: add reverse proxy config 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
build:
	mkdir -p build
	rm -f build/links
	find lists -type f | sort | xargs -n1 basename | while read l; do \
		TITLE=$$( sed -n '1s/^# //p' lists/$$l ); \
		ID=0; \
		rm -f build/items; \
		sed '1d' lists/$$l | while read i; do \
			ID=$$(( ID + 1 )); \
			sed -e "s/{ID}/$$ID/g" -e "s/{ITEM}/$$i/g" templates/item.html >> build/items; \
		done; \
		sed -e "s/{TITLE}/$$TITLE/g" -e '/{ITEMS}/ {r build/items' -e 'd }' templates/list.html > root/$$l.html; \
		printf '<a href="%s">%s</a>\n' $$l "$$TITLE" >> build/links; \
	done
	sed -e '/{LINKS}/ {r build/links' -e 'd }' templates/index.html > root/index.html

install:
	mkdir -p $(DESTDIR)/srv/http/check
	cp -r root/* $(DESTDIR)/srv/http/check
	mkdir -p $(DESTDIR)/etc/nginx/http.d
	cp nginx.conf $(DESTDIR)/etc/nginx/http.d/check.conf

deploy:
	rsync -az --delete root/ chestnut:/srv/http/check/

clean:
	rm -rf build

.PHONY: build clean deploy install