Skip to content

Commit e536708

Browse files
committed
feat: added systemd timers for notifications and syncing
1 parent 5e0f63a commit e536708

5 files changed

+37
-0
lines changed

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
api:
1111
build: ./api
1212
user: "${UID:?Set UID env variable to your user id}"
13+
container_name: "outdated-api"
1314
depends_on:
1415
- db
1516
ember:

systemd/notifications.service

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Send email notifications to users
3+
Wants=notifications.timer
4+
5+
[Service]
6+
ExecStart=docker exec outdated-api sh -c './manage.py notify'
7+
8+
[Install]
9+
WantedBy=multi-user.target

systemd/notifications.timer

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Send notifications every monday morning
3+
4+
[Timer]
5+
Unit=notifications.service
6+
OnCalendar=Mon *-*-* 00:00:00
7+
8+
[Install]
9+
WantedBy=timers.target

systemd/syncprojects.service

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Synchronise projects
3+
Wants=syncprojects.timer
4+
5+
[Service]
6+
ExecStart=docker exec outdated-api sh -c './manage.py syncprojects'
7+
8+
[Install]
9+
WantedBy=multi-user.target

systemd/syncprojects.timer

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Send notifications every monday morning
3+
4+
[Timer]
5+
Unit=syncprojects.service
6+
OnCalendar=Mon *-*-* 00:00:00
7+
8+
[Install]
9+
WantedBy=timers.target

0 commit comments

Comments
 (0)