Add systemd deployment example
continuous-integration/drone/push Build is passing Details

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
Jacob Kiers 2022-09-06 23:36:37 +02:00
parent 575495bf2c
commit ea57f625e4
3 changed files with 35 additions and 0 deletions

18
systemd/build-feed.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -euo pipefail
N2W='/path/to/newsletter-to-web'
# I used dav2fs to mount a DAV filesystem, so that the feed is
# automatically published.
#
# This symlinked the output/ folder to dav/
#mount $(pwd)/dav || true
# Change the credentials
${N2W} fetch-from-imap -s mail.example.org --username newsletters@example.org --password 'SuperSecret'
# -i: Include the full text
# newsletters.example.org: hostname where the feed is hosted
${N2W} build-feed -i newsletters.example.org

View File

@ -0,0 +1,7 @@
[Unit]
Description=Create newsletter feed
[Service]
Type=oneshot
WorkingDirectory=/home/n2w
ExecStart=/home/n2w/build-feed.sh

View File

@ -0,0 +1,10 @@
[Unit]
Description=Publish newsletters
[Timer]
# Run two times a day, starting at 01:38
OnCalendar=*-*-* 09/12:38:00
Persistent=true
[Install]
WantedBy=default.target