-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMakefile
61 lines (52 loc) · 1.22 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
55
56
57
58
59
60
61
SRC=.
DST=nornir-automation.github.io
HUGO_VERSION=v0.65.3
DOCKER_HUGO=docker run \
-it \
-v $(PWD):/nornir.tech \
-p 1313:1313 \
nornir.tech:latest
HUGO_OPTS=--source $(SRC) --destination $(DST)
HUGO_TEST_OPTS=-D -E -F --disableFastRender --bind 0.0.0.0
.PHONY: docker-image
docker-image:
docker build \
--build-arg HUGO_VERSION=$(HUGO_VERSION) \
--build-arg USER=$(shell id -un) \
--build-arg USERID=$(shell id -u) \
--build-arg GROUP=$(shell id -gn) \
--build-arg GROUPID=$(shell id -g) \
-t nornir.tech:latest \
-f Dockerfile \
.
.PHONY: serve
serve: clean
hugo serve \
$(HUGO_TEST_OPTS) \
$(HUGO_OPTS)
.PHONY: gen
gen: clean
hugo \
$(HUGO_OPTS)
.PHONY: docker-serve
docker-serve: clean
$(DOCKER_HUGO) make serve
.PHONY: docker-gen
docker-gen: clean
$(DOCKER_HUGO) make gen
.PHONY: clean
clean:
cd $(DST) && \
find -maxdepth 1 -not \(\
-name '.*' -or \
-name 'CNAME' -or \
\) -print0 | xargs -0 -I {} rm -rf {}
.PHONY: publish
publish:
cd $(DST) && \
git add . && \
git commit -m "published from nornir.tech.src $(shell git rev-parse --short HEAD)" && \
git push origin HEAD:master
git add nornir-automation.github.io
git commit -m "updated submodule nornir-automation.github.io"
git push