hugo: Move to Quadlet, minify HTML by default

This commit is contained in:
Alex Palaistras 2023-08-12 16:49:20 +01:00
parent 3465082806
commit 7764f0fde0
4 changed files with 22 additions and 29 deletions

View File

@ -28,4 +28,4 @@ else
cd "$GIT_DIR_NAME"
fi
hugo --verbose --destination "/build/${GIT_DIR_NAME}"
hugo --logLevel info --minify --destination "/build/${GIT_DIR_NAME}"

View File

@ -0,0 +1,19 @@
[Unit]
Description=Hugo static site builder
Wants=container-build@%N.service container-volume@%N.service nginx-serve-volume@%N.service
After=container-build@%N.service container-volume@%N.service
Before=nginx-serve-volume@%N.service
[Container]
ContainerName=%N
EnvironmentFile=%E/coreos-home-server/%N/%N.env
Image=localhost/%N:latest
Network=internal
Volume=%N:/build:z
Volume=%N-ssh:/etc/ssh/keys:z
[Service]
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -4,9 +4,5 @@ storage:
trees:
- path: /etc/coreos-home-server/hugo
local: service/hugo/
- path: /etc/systemd/system
local: service/hugo/systemd/
systemd:
units:
- name: hugo.service
enabled: true
- path: /etc/containers/systemd
local: service/hugo/quadlet/

View File

@ -1,22 +0,0 @@
[Unit]
Description=Hugo static site builder
Wants=container-build@%N.service container-volume@%N.service nginx-serve-volume@%N.service
After=container-build@%N.service container-volume@%N.service
Before=nginx-serve-volume@%N.service
[Service]
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
Restart=on-failure
Environment=PODMAN_SYSTEMD_UNIT=%n
ExecStart=/bin/podman run --replace --name %N --net internal --sdnotify=conmon \
--env-file %E/coreos-home-server/%N/%N.env \
--volume %N:/build:z \
--volume %N-ssh:/etc/ssh/keys:z \
localhost/%N:latest
ExecStop=/bin/podman stop --ignore --time 10 %N
ExecStopPost=/bin/podman rm --ignore --force %N
[Install]
WantedBy=multi-user.target