coreos-home-server/service/hugo/container/run-hugo
Alex Palaistras a99e97abfe hugo: Switch to webhook-based builder
This commit switches Hugo to a webhook-based building process, with
support for Github, Gitlab, and Gitea hooks (including local versions of
Gitea) initially. In addition, Hugo-based sites are now intended to be
served under a single volume, with ingress configuration pointing to
sub-paths into the volume.

Documentation for webhook setup and NGINX proxy configuration is still
underway, and will be filled in later.
2022-10-28 17:52:05 +01:00

21 lines
638 B
Bash
Executable File

#!/bin/sh
set -eu
# Generate host keys if none were found.
for t in rsa ecdsa ed25519; do
if test ! -f /etc/ssh/keys/ssh_host_${t}_key; then
ssh-keygen -q -t $t -f /etc/ssh/keys/ssh_host_${t}_key -C '' -N '' > /dev/null
chown hugo:hugo /etc/ssh/keys/ssh_host_${t}_key*
fi
echo "Host key type '$t' for SSH authentication:"
cat /etc/ssh/keys/ssh_host_${t}_key.pub
done
# Create configuration file from collected templates.
envsubst < /etc/hugo/hooks.yaml.template > /etc/hugo/hooks.yaml
# Run webhook listener for configured hooks.
gosu hugo /bin/webhook -verbose -port 8080 -hooks /etc/hugo/hooks.yaml