From a928256a4f6049dc9bac20ccfcfdbdfc75783043 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Fri, 18 Aug 2023 20:48:32 +0800 Subject: [PATCH] Add systemd service for static-deployer --- packages/leafee98/static-deployer-git/DEBBUILD | 10 ++++------ .../materials/static-deployer.service | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 packages/leafee98/static-deployer-git/materials/static-deployer.service diff --git a/packages/leafee98/static-deployer-git/DEBBUILD b/packages/leafee98/static-deployer-git/DEBBUILD index 546118e..9704b76 100644 --- a/packages/leafee98/static-deployer-git/DEBBUILD +++ b/packages/leafee98/static-deployer-git/DEBBUILD @@ -3,24 +3,22 @@ pkgname="static-deployer" arch="amd64" pkgver=0.0.6.g7067e8f -pkgrel=1 +pkgrel=2 pkgdesc="A simple daemon to deploy static site" url="https://git.leafee98.com/leafee98/static_deployer" maintainer="Leafee98 " source=( "static_deployer::git+https://git.leafee98.com/leafee98/static_deployer.git" + "static-deployer.service::materials/static-deployer.service" ) -function pkgver { - git -C src/static_deployer describe --tags --long | sed -e 's/^v//; s/-/./g' -} - function pkgver { git -C "${srcdir}/static_deployer" describe --tags --long | sed 's/^v//;s/-/./g' } function package { - install -D "${srcdir}/static_deployer/main.py" "${pkgdir}/usr/bin/static-deployer" + install -Dm755 "${srcdir}/static_deployer/main.py" "${pkgdir}/usr/bin/static-deployer" + install -Dm644 "${srcdir}/static-deployer.service" "${pkgdir}/usr/lib/systemd/system/static-deployer.service" } diff --git a/packages/leafee98/static-deployer-git/materials/static-deployer.service b/packages/leafee98/static-deployer-git/materials/static-deployer.service new file mode 100644 index 0000000..98b10a7 --- /dev/null +++ b/packages/leafee98/static-deployer-git/materials/static-deployer.service @@ -0,0 +1,14 @@ +[Unit] +Description=A simple daemon to deploy static site +After=network.target apache2.service + +[Service] +# User=www-data +# Group=www-data + +ExecStart=/usr/bin/static-deployer --archive-dir /srv/www/blog/archive --extract-dir /srv/www/blog/extract --symlink-path /srv/www/blog/serve --port 8084 +Restart=on-failure + +[Install] +WantedBy=multi-user.target +