Add systemd deployment example
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
This commit is contained in:
parent
575495bf2c
commit
ea57f625e4
18
systemd/build-feed.sh
Executable file
18
systemd/build-feed.sh
Executable 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
|
7
systemd/newsletter2web.service
Normal file
7
systemd/newsletter2web.service
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Create newsletter feed
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
WorkingDirectory=/home/n2w
|
||||||
|
ExecStart=/home/n2w/build-feed.sh
|
10
systemd/newsletter2web.timer
Normal file
10
systemd/newsletter2web.timer
Normal 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
|
Loading…
Reference in New Issue
Block a user