Push Notifications #24
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
apk add --upgrade --no-cache restic bash python3 py3-pip py3-click py3-docker-py py3-json-logger
|
||||
apk add --upgrade --no-cache restic bash python3 py3-pip py3-click py3-docker-py py3-json-logger curl
|
||||
|
||||
# Todo use requirements file with specific versions
|
||||
pip install --break-system-packages resticpy==1.0.2
|
||||
@ -14,7 +14,23 @@ fi
|
||||
|
||||
cron_schedule="${CRON_SCHEDULE:?CRON_SCHEDULE not set}"
|
||||
|
||||
echo "$cron_schedule backup --machine-logs create" | crontab -
|
||||
if [ -n "$PUSH_URL_START" ]
|
||||
then
|
||||
push_start_notification="curl -s '$PUSH_URL_START' &&"
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$PUSH_URL_SUCCESS" ]
|
||||
then
|
||||
push_success_notification=" 2>&1 | tee /tmp/backup.log && grep -q 'backup finished' /tmp/backup.log && curl -s '$PUSH_URL_SUCCESS'"
|
||||
fi
|
||||
|
||||
if [ -n "$PUSH_URL_FAIL" ]
|
||||
then
|
||||
push_fail_notification="|| curl -s '$PUSH_URL_FAIL'"
|
||||
fi
|
||||
|
||||
echo "$cron_schedule $push_start_notification backup --machine-logs create $push_success_notification $push_fail_notification" | crontab -
|
||||
crontab -l
|
||||
|
||||
crond -f -d8 -L /dev/stdout
|
||||
|
Reference in New Issue
Block a user