Skip to content

Commit aa19341

Browse files
authored
Merge pull request #21630 from rlenferink/rename-docker
Renamed docker-* targets to container-* and deprecated docker-* targets
2 parents fdd411a + 58cd5ae commit aa19341

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

Makefile

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
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
714

815
.PHONY: all build build-preview help serve
916

@@ -36,25 +43,42 @@ serve: ## Boot the development server.
3643
hugo server --buildFuture
3744

3845
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
4348

4449
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
4652

4753
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
4968

5069
test-examples:
5170
scripts/test_examples.sh install
5271
scripts/test_examples.sh run
5372

5473
.PHONY: link-checker-setup
5574
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
5784

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

Comments
 (0)