1
- DOCKER ?= docker
2
- HUGO_VERSION = $(shell grep ^HUGO_VERSION netlify.toml | tail -n 1 | cut -d '=' -f 2 | tr -d " \"\n")
3
- DOCKER_IMAGE = kubernetes-hugo
4
- DOCKER_RUN = $(DOCKER ) run --rm --interactive --tty --volume $(CURDIR ) :/src
5
- NODE_BIN = node_modules/.bin
6
- NETLIFY_FUNC = $(NODE_BIN ) /netlify-lambda
1
+ HUGO_VERSION = $(shell grep ^HUGO_VERSION netlify.toml | tail -n 1 | cut -d '=' -f 2 | tr -d " \"\n")
2
+ NODE_BIN = node_modules/.bin
3
+ NETLIFY_FUNC = $(NODE_BIN ) /netlify-lambda
4
+
5
+ # The CONTAINER_ENGINE variable is used for specifying the container engine. By default 'docker' is used
6
+ # but this can be overridden when calling make, e.g.
7
+ # CONTAINER_ENGINE=podman make container-image
8
+ CONTAINER_ENGINE ?= docker
9
+ CONTAINER_IMAGE = kubernetes-hugo
10
+ CONTAINER_RUN = $(CONTAINER_ENGINE ) run --rm --interactive --tty --volume $(CURDIR ) :/src
11
+
12
+ CCRED =\033[0;31m
13
+ CCEND =\033[0m
7
14
8
15
.PHONY : all build build-preview help serve
9
16
@@ -36,25 +43,42 @@ serve: ## Boot the development server.
36
43
hugo server --buildFuture
37
44
38
45
docker-image :
39
- $(DOCKER ) build . \
40
- --network=host \
41
- --tag $(DOCKER_IMAGE ) \
42
- --build-arg HUGO_VERSION=$(HUGO_VERSION )
46
+ @echo -e " $( CCRED) **** The use of docker-image is deprecated. Use container-image instead. ****$( CCEND) "
47
+ $(MAKE ) container-image
43
48
44
49
docker-build :
45
- $(DOCKER_RUN ) $(DOCKER_IMAGE ) hugo
50
+ @echo -e " $( CCRED) **** The use of docker-build is deprecated. Use container-build instead. ****$( CCEND) "
51
+ $(MAKE ) container-build
46
52
47
53
docker-serve :
48
- $(DOCKER_RUN ) --mount type=tmpfs,destination=/src/resources,tmpfs-mode=0755 -p 1313:1313 $(DOCKER_IMAGE ) hugo server --buildFuture --bind 0.0.0.0
54
+ @echo -e " $( CCRED) **** The use of docker-serve is deprecated. Use container-serve instead. ****$( CCEND) "
55
+ $(MAKE ) container-serve
56
+
57
+ container-image :
58
+ $(CONTAINER_ENGINE ) build . \
59
+ --network=host \
60
+ --tag $(CONTAINER_IMAGE ) \
61
+ --build-arg HUGO_VERSION=$(HUGO_VERSION )
62
+
63
+ container-build :
64
+ $(CONTAINER_RUN ) $(CONTAINER_IMAGE ) hugo
65
+
66
+ container-serve :
67
+ $(CONTAINER_RUN ) --mount type=tmpfs,destination=/src/resources,tmpfs-mode=0755 -p 1313:1313 $(CONTAINER_IMAGE ) hugo server --buildFuture --bind 0.0.0.0
49
68
50
69
test-examples :
51
70
scripts/test_examples.sh install
52
71
scripts/test_examples.sh run
53
72
54
73
.PHONY : link-checker-setup
55
74
link-checker-image-pull :
56
- docker pull wjdp/htmltest
75
+ $(CONTAINER_ENGINE ) pull wjdp/htmltest
76
+
77
+ docker-internal-linkcheck :
78
+ @echo -e " $( CCRED) **** The use of docker-internal-linkcheck is deprecated. Use container-internal-linkcheck instead. ****$( CCEND) "
79
+ $(MAKE ) container-internal-linkcheck
80
+
81
+ container-internal-linkcheck : link-checker-image-pull
82
+ $(CONTAINER_RUN ) $(CONTAINER_IMAGE ) hugo --config config.toml,linkcheck-config.toml --buildFuture
83
+ $(CONTAINER_ENGINE ) run --mount type=bind,source=$(CURDIR ) ,target=/test --rm wjdp/htmltest htmltest
57
84
58
- docker-internal-linkcheck : link-checker-image-pull
59
- $(DOCKER_RUN ) $(DOCKER_IMAGE ) hugo --config config.toml,linkcheck-config.toml --buildFuture
60
- $(DOCKER ) run --mount type=bind,source=$(CURDIR ) ,target=/test --rm wjdp/htmltest htmltest
0 commit comments