-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provide hugo container and make target (#426)
* provide hugo container and make target * build target * revert build target - need to fix this in the future
- Loading branch information
1 parent
742ad37
commit a111840
Showing
3 changed files
with
45 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
FROM klakegg/hugo:ext-alpine | ||
FROM registry.fedoraproject.org/fedora-minimal | ||
|
||
RUN apk add git | ||
ARG HUGO_VERSION | ||
|
||
VOLUME /site | ||
WORKDIR /site | ||
|
||
# Avoid startup errors about missing AsciiDoctor | ||
ARG ASCIIDOCTOR_VERSION=2.0.10 | ||
RUN microdnf -y install ruby | ||
RUN gem install --no-document "asciidoctor:${ASCIIDOCTOR_VERSION}" | ||
|
||
# Download, untar, and install Hugo | ||
RUN microdnf -y install tar shadow-utils git nodejs \ | ||
&& microdnf clean all | ||
|
||
ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz /hugo.tar.gz | ||
RUN tar xzvf /hugo.tar.gz -C / \ | ||
&& rm /hugo.tar.gz \ | ||
&& mv /hugo /usr/bin/hugo | ||
|
||
# Stuff for docsy | ||
RUN npm -g -D install postcss postcss-cli autoprefixer | ||
|
||
# Confirm hugo binary is available and show its version | ||
RUN hugo version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
HUGO_VERSION ?= 0.75.0 | ||
DORP ?= podman | ||
KIALI_HUGO_IMAGE ?= kiali/hugo:latest | ||
|
||
.prepare-force-build: | ||
ifeq ($(DORP),docker) | ||
@$(eval FORCE_BUILD ?= $(shell docker inspect ${KIALI_HUGO_IMAGE} > /dev/null 2>&1 || echo "true")) | ||
else | ||
@$(eval FORCE_BUILD ?= $(shell podman inspect ${KIALI_HUGO_IMAGE} > /dev/null 2>&1 || echo "true")) | ||
endif | ||
|
||
## build-hugo: Builds the hugo image if necessary. You can force a rebuild by setting the environment variable "FORCE_BUILD=true". | ||
.PHONY: build-hugo | ||
build-hugo: .prepare-force-build | ||
@if [ "${FORCE_BUILD}" == "true" ]; then ${DORP} build --build-arg HUGO_VERSION=${HUGO_VERSION} -t ${KIALI_HUGO_IMAGE} . ; else echo "Will not rebuild the image [${KIALI_HUGO_IMAGE}]."; fi | ||
|
||
## serve: If necessary, builds the image and then runs a hugo server on your local machine at localhost:1313 | ||
.PHONY: serve | ||
serve: build-hugo | ||
@${DORP} run -t -i --sig-proxy=true --rm -v "$(shell pwd)":/site:z -w /site -p 1313:1313 ${KIALI_HUGO_IMAGE} hugo serve --baseURL "http://localhost:1313/" --bind 0.0.0.0 --disableFastRender |
This file was deleted.
Oops, something went wrong.