-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
48 lines (41 loc) · 966 Bytes
/
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
SRC=_src
DST=../
HUGO_IMAGE=nornir3_demo_hugo:latest
HUGO_VERSION=v0.72.0
DOCKER_HUGO=docker run \
-it \
-v $(PWD)/docs:/src \
-p 1313:1313 \
$(HUGO_IMAGE)
HUGO_OPTS=--source $(SRC) --destination $(DST)
HUGO_TEST_OPTS=-D -E -F --disableFastRender --bind 0.0.0.0
.PHONY: hugo-docker-image
hugo-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 $(HUGO_IMAGE) \
-f Dockerfile.hugo \
.
.PHONY: docker-serve
docker-serve: clean
$(DOCKER_HUGO) hugo serve \
$(HUGO_TEST_OPTS) \
$(HUGO_OPTS)
.PHONY: docker-gen
docker-gen: clean
$(DOCKER_HUGO) hugo \
$(HUGO_OPTS)
.PHONY: start
start:
$(DOCKER_HUGO) hugo new site nornir3_demo
.PHONY: clean
clean:
cd docs/ && \
find -maxdepth 1 -not \(\
-name '.*' -or \
-name '_src' \
\) -print0 | xargs -0 -I {} rm -rf {}