mirror of https://github.com/helm/helm-www.git
Update Dockerfile and Makefile to support dynamic Hugo version
Signed-off-by: Andrii Holovin <Andygol@users.noreply.github.com>
This commit is contained in:
parent
18d293f987
commit
abb751c85a
|
|
@ -1,4 +1,5 @@
|
|||
FROM hugomods/hugo:node
|
||||
ARG HUGO_VERSION=
|
||||
FROM hugomods/hugo:node-${HUGO_VERSION}
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
|
|
|
|||
8
Makefile
8
Makefile
|
|
@ -26,11 +26,15 @@ check-links-ci: set-up-link-checker run-link-checker
|
|||
serve:
|
||||
hugo server --buildDrafts --buildFuture --bind 0.0.0.0
|
||||
|
||||
HUGO_VERSION ?= $(shell grep HUGO_VERSION ./netlify.toml | head -1 | cut -d '"' -f 2)
|
||||
|
||||
IMAGE_NAME ?= helm-docs
|
||||
|
||||
image:
|
||||
docker build -t helm-docs .
|
||||
docker build --build-arg HUGO_VERSION=$(HUGO_VERSION) -t $(IMAGE_NAME) .
|
||||
|
||||
# Extract the target after 'image-run' or default to 'serve'
|
||||
DOCKER_TARGET = $(if $(filter-out image-run,$(MAKECMDGOALS)),$(filter-out image-run,$(MAKECMDGOALS)),serve)
|
||||
|
||||
image-run:
|
||||
docker run --rm --init -it -p 1313:1313 -v $(PWD):/src helm-docs $(DOCKER_TARGET)
|
||||
docker run --rm --init -it -p 1313:1313 -v $(PWD):/src $(IMAGE_NAME) $(DOCKER_TARGET)
|
||||
|
|
|
|||
Loading…
Reference in New Issue