cron job persist-ci: don't return fail if running

Signed-off-by: kiara <kiara@bij1.org>
This commit is contained in:
kiara 2023-09-03 13:15:09 +00:00
parent 7e0987c5a3
commit 7ac33d72a2
1 changed files with 14 additions and 1 deletions

View File

@ -3,4 +3,17 @@
cron__jobs:
'persist-ci':
job: 'docker start woodpecker_woodpecker-server_1'
job: '/usr/local/lib/checkwoodpecker.sh'
custom_files:
- dest: '/usr/local/lib/checkwoodpecker.sh'
content: |
#!/bin/bash
# check for running woodpecker, if needed restart
state="$(docker inspect woodpecker_woodpecker-server_1 --format '{{.State.Status}}')"
if [ "$state" != "running" ]; then
echo "woodpecker down at $HOSTNAME , attempting restart"
docker start woodpecker_woodpecker-server_1
fi