-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitedditor.service
27 lines (18 loc) · 1.03 KB
/
gitedditor.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[Unit]
Description=Mirrors reddit comments into a git repo
After=network-online.target
[Service]
#Default Environment=GITREDDITOR_CNT=20
#Default Environment=GITREDDITOR_TH=5
#Default Environment=GITREDDITOR_THP=5
Environment=GITREDDITOR_U=root
Environment=ROOT_DIR=/srv/reddit
RestartSec=7200
Restart=always
ExecStartPre=/bin/bash -c "cd ${ROOT_DIR}/${GITREDDITOR_U} && /usr/bin/git config user.name ${GITREDDITOR_U} && /usr/bin/git config user.email reddit.com/u/${GITREDDITOR_U}"
ExecStartPre=/bin/bash -c "cd ${ROOT_DIR}/${GITREDDITOR_U} && /usr/bin/git pull"
ExecStart=/usr/bin/rkt --insecure-options=image run --inherit-env --dns 8.8.8.8 --volume volume-repo,kind=host,source=${ROOT_DIR}/${GITREDDITOR_U} --volume volume-stats,kind=host,source=${ROOT_DIR}/stats/${GITREDDITOR_U} \
docker://repo.shimun.net/shimun/gitredditor --exec sh -- -c 'gitredditor && gitredditor-stats'
ExecStopPost=/bin/bash -c "cd ${ROOT_DIR}/${GITREDDITOR_U} && /usr/bin/git push"
[Install]
WantedBy=multi-user.target