git ssb

0+

Grey the earthling / gkn.me.uk



Tree: 7155a07c0cdf67519fc55a08e30007e927e06398

Files: 7155a07c0cdf67519fc55a08e30007e927e06398 / Makefile

1346 bytesRaw
1.PHONY: lint clean check-publish publish serve
2
3output: $(shell find content static) .cache/generator .cache/lint
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
19lint: .cache/lint
20
21.cache/lint: $(shell find static/style)
22 toolbox run npx -y prettier -w static/style/tarazed.css
23 touch $@
24
25clean: .cache/clean
26
27.cache/clean: $(shell find output/*)
28 rm -r output
29 touch $@
30
31check-publish:
32ifeq "${SSHUSER}" ""
33 @echo "SSHUSER is undefined"
34 @exit 1
35else ifeq "${SSHPASS}" ""
36 @echo "SSHPASS is undefined"
37 @exit 1
38else ifeq "${SSHDIR}" ""
39 @echo "SSHDIR is undefined"
40 @exit 1
41else ifeq "${SSHPORT}" ""
42 @echo "SSHPORT is undefined"
43 @exit 1
44else ifneq "$(shell git status --porcelain)" ""
45 @echo "Uncommitted changes:"
46 @git status --porcelain
47 @exit 1
48endif
49
50publish: clean check-publish .cache/publish
51
52.cache/publish: output
53 echo -e "cd ${SSHDIR} \n put -r output/* \n exit" | \
54 sshpass -e sftp -oBatchMode=no -b - sftp://${SSHUSER}@gkn.me.uk:${SSHPORT}
55 touch $@
56
57serve: output
58 cd output && python -m http.server
59

Built with git-ssb-web