Skip to content
Snippets Groups Projects
Commit 8be11b00 authored by Martyn Welch's avatar Martyn Welch Committed by Martyn Welch
Browse files

Add basic run script, update used docker image and document


We have been using an old version of hugo in the gitlab registry as the
latest version available at the time this was setup had a show stopping
bug. Update the version of hugo used and switch to the docker image
recommended by the Hugo project as this is potentially easier for those
behind restrictive proxies to access.

Provide a helper script to also make it easier to run Hugo from docker as
a developer and document it. Use the `--rm` option to cause docker to
remove the container once it's exited to avoid them building up and add
`--security-opt label=disable` for those using an SELinux enabled
distribution.

Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
parent 68cfe2ea
No related branches found
No related tags found
1 merge request!219Review of concept documents
# All available Hugo versions are listed here: https://gitlab.com/pages/hugo/container_registry
#image: registry.gitlab.com/pages/hugo:latest
# Locking to v0.62.2 for now - hit by bug, 0.63.2 not available yet with fix:
# https://github.com/gohugoio/hugo/issues/6805
variables:
GIT_SUBMODULE_STRATEGY: recursive
......@@ -12,7 +6,9 @@ stages:
- generate-pdf
test-html:
image: registry.gitlab.com/pages/hugo:0.62.2
image:
name: klakegg/hugo:latest
entrypoint: [""]
stage: generate-html
tags:
- lightweight
......
......@@ -132,15 +132,9 @@ defined in [`.gitlab-ci.yml`](.gitlab-ci.yml).
## Building locally
To work locally with this project, you'll have to follow the steps below:
1. Fork, clone or download this project
1. [Install][https://gohugo.io/overview/installing/] Hugo
1. Preview your project: `hugo server`
1. Add content
1. Generate the website: `hugo` (optional)
Read more at Hugo's [documentation][https://gohugo.io/overview/introduction/].
The `run_hugo.sh` script is provided to run Hugo from docker. Running this
script will generate the site, running `./run_hugo.sh server` will serve the
site locally on `http://localhost:1313`.
### Preview your site
......
#!/bin/bash
REPO=$(dirname $(realpath $0))
docker run \
--rm \
-p 1313:1313/tcp \
-w /source \
-u $(id -u) \
-v ${REPO}:/source \
--security-opt label=disable \
klakegg/hugo:latest \
$@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment