fix(website): build on Hugo 0.147 again (site.Data), chown site trees even when the CI build fails
hugo.Data is not available in the alpine Hugo the deploy job uses; the failed render left the webroot half-cleaned and root-owned because the chown only ran after a successful build. It is an EXIT trap now. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MScAinbyMdeNc7H2BZdnnG
This commit is contained in:
parent
5d827e5eab
commit
22ce03d1f0
2 changed files with 9 additions and 8 deletions
|
|
@ -11,6 +11,13 @@ HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||||
SRCROOT="${FURTKA_SRCROOT:-/srv/furtka-site}"
|
SRCROOT="${FURTKA_SRCROOT:-/srv/furtka-site}"
|
||||||
WEBROOT="${FURTKA_WEBROOT:-/var/www/furtka.org}"
|
WEBROOT="${FURTKA_WEBROOT:-/var/www/furtka.org}"
|
||||||
|
|
||||||
|
# The runner job runs as root inside the container; hand the trees back
|
||||||
|
# to the VM user no matter how this script ends, so the manual deploy.sh
|
||||||
|
# path keeps working even after a failed build.
|
||||||
|
if [ "$(id -u)" = 0 ]; then
|
||||||
|
trap 'chown -R "${FURTKA_OWNER:-1000:1000}" "$SRCROOT" "$WEBROOT"' EXIT
|
||||||
|
fi
|
||||||
|
|
||||||
echo "==> rsync website/ → $SRCROOT"
|
echo "==> rsync website/ → $SRCROOT"
|
||||||
rsync -az --delete \
|
rsync -az --delete \
|
||||||
--exclude='.hugo_build.lock' \
|
--exclude='.hugo_build.lock' \
|
||||||
|
|
@ -24,10 +31,4 @@ echo "==> hugo build → $WEBROOT"
|
||||||
cd "$SRCROOT"
|
cd "$SRCROOT"
|
||||||
hugo --minify --cleanDestinationDir -d "$WEBROOT"
|
hugo --minify --cleanDestinationDir -d "$WEBROOT"
|
||||||
|
|
||||||
# The runner job runs as root inside the container; hand the trees back
|
|
||||||
# to the VM user so the manual deploy.sh path keeps working afterwards.
|
|
||||||
if [ "$(id -u)" = 0 ]; then
|
|
||||||
chown -R "${FURTKA_OWNER:-1000:1000}" "$SRCROOT" "$WEBROOT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "OK: deployed to https://furtka.org/"
|
echo "OK: deployed to https://furtka.org/"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{- $p := .Params -}}
|
{{- $p := .Params -}}
|
||||||
{{- $M := hugo.Data.logo.m -}}
|
{{- $M := site.Data.logo.m -}}
|
||||||
{{- $R := hugo.Data.logo.r -}}
|
{{- $R := site.Data.logo.r -}}
|
||||||
{{- $s := $p.show -}}
|
{{- $s := $p.show -}}
|
||||||
<article class="poll" data-poll="{{ $p.poll }}" data-api="/api/poll/{{ $p.poll }}">
|
<article class="poll" data-poll="{{ $p.poll }}" data-api="/api/poll/{{ $p.poll }}">
|
||||||
<header class="page-header">
|
<header class="page-header">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue