git ssb

0+

Grey the earthling / gkn.me.uk



Tree: 0ec06f1a1911767feb7effe12b399cff8c28bc3c

Files: 0ec06f1a1911767feb7effe12b399cff8c28bc3c / Makefile

1182 bytesRaw
1.PHONY: status publish lint serve
2
3output: $(shell find content static) .cache/generator
4 python generator/generate.py
5 touch $@
6
7.cache/generator: $(shell find generator) .cache/deps
8 python -m black --experimental-string-processing .
9 touch $@
10
11.cache/deps: Makefile
12 toolbox run pip install black
13 toolbox run pip install beautifulsoup4==4.9.3
14 toolbox run pip install marko==1.1.0
15 toolbox run pip install python-frontmatter==1.0.0
16 mkdir -p .cache
17 touch $@
18
19status:
20ifeq "${SSHUSER}" ""
21 @echo "SSHUSER is undefined"
22 @exit 1
23else ifeq "${SSHPASS}" ""
24 @echo "SSHPASS is undefined"
25 @exit 1
26else ifeq "${SSHDIR}" ""
27 @echo "SSHDIR is undefined"
28 @exit 1
29else ifeq "${SSHPORT}" ""
30 @echo "SSHPORT is undefined"
31 @exit 1
32else ifneq "$(shell git status --porcelain)" ""
33 @echo "Uncommitted changes:"
34 @git status --porcelain
35 @exit 1
36endif
37
38publish: status .cache/publish
39
40.cache/publish: output
41 echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \
42 sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT}
43 touch $@
44
45lint: $(shell find static/style)
46 toolbox run npx -y prettier -w static/style/tarazed.css
47
48serve: output
49 cd output && python -m http.server
50

Built with git-ssb-web