coreos-home-server/service/hugo/systemd/hugo-build-local@.service
Alex Palaistras 3aea8f42d9 hugo: Add service for building Hugo-based sites
By default, a `hugo-build-local@.service` systemd service is included,
for building Hugo-based sites as stored in a local Git repository (as
served by the `git` service), and into a volume (which is intended to be
served by the `nginx-serve-volume` service).
2022-04-18 18:19:14 +01:00

22 lines
790 B
Desktop File

[Unit]
Description=Hugo Build for Local %I Repository
Wants=container-build@hugo.service container-volume@hugo-build-%i.service git.service
After=container-build@hugo.service container-volume@hugo-build-%i.service git.service
[Service]
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
Restart=on-failure
Environment=PODMAN_SYSTEMD_UNIT=%n
Environment=GIT_REPO=%i.git GIT_BRANCH=master
ExecStart=/bin/podman run --replace --name %p-%i --net internal --sdnotify=conmon \
--volume git:/src:z,ro \
--volume hugo-build-%i:/dest:z \
localhost/hugo:latest $GIT_REPO $GIT_BRANCH
ExecStop=/bin/podman stop --ignore --time 10 %p-%i
ExecStopPost=/bin/podman rm --ignore --force %p-%i
[Install]
WantedBy=multi-user.target