-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
54 lines (41 loc) · 1.28 KB
/
Makefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
push:
git push
generate:
ls -lha /var/website
du -hs *
hugo
du -hs *
preview:
hugo server --bind 0.0.0.0
TS := $(date)
public:
git clone -b master [email protected]:goconca/goconca.github.io.git public
deploy: public
cd public \
&& git add . \
&& (git commit -a -m "Website updated at $(shell date)" || echo "Nothing to commit") \
&& git push \
&& cd ..
USER=$(shell whoami)
UID=$(shell id -u $(USER))
docker-image:
docker build --build-arg GNZHUID=$(UID) -t website-builder .
docker-rm:
docker kill website-builder || echo "Not found"
docker rm website-builder || echo "Not found"
generate-using-docker: docker-image docker-rm public submodules
docker run --rm -t -v $(shell pwd):/var/website --name website-builder website-builder make generate
deploy-using-docker: public
make generate-using-docker
make deploy
make push
preview-using-docker: docker-image docker-rm public sudmodules
docker run --rm -t -v $(shell pwd):/var/website -p 1313:1313 --name website-builder website-builder make preview
debug-using-docker: docker-image docker-rm public submodules
docker run --rm -ti -v $(shell pwd):/var/website -p 1313:1313 --name website-builder website-builder bash
sudmodules:
git submodule update --init
clean:
rm resources/_gen/ -rf
submodules:
git submodule update --init