Skip to content

Commit

Permalink
Merge pull request #3154 from gleidi-suse/fix_auto_freeze
Browse files Browse the repository at this point in the history
gocd: slfo-stagings: Avoid busy waiting for 50 minutes, instead rely on scheduling from GoCD.
  • Loading branch information
gleidi-suse committed Sep 4, 2024
2 parents 94791de + 64ff73b commit da9a918
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 8 additions & 3 deletions gocd/slfo-stagings.gocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ pipelines:
- staging-bot
tasks:
- script: |-
set -eu
export PYTHONPATH=$PWD/scripts
cd scripts/gocd
while osc -A $STAGING_API api /build/$SLFO_RING_1_PROJECT/standard/x86_64?view=status | grep 'code=' | sed -E 's/^.*code="(.*)".*$/\1/' | grep -q finished; ret=$?; [ ${ret} -ne 0 ]; do
sleep 60
done
status="$(osc -A $STAGING_API api /build/$SLFO_RING_1_PROJECT/standard/x86_64?view=status | grep 'code=' | sed -E 's/^.*code="(.*)".*$/\1/')"
echo $SLFO_RING_1_PROJECT status: "${status}"
if [ printf '%s' "${status}" | grep -q finished ]; then
exit 0
else
exit 1
fi
- Freeze.stagings:
## 6 hours (at most 30 minutes per staging)
timeout: 360
Expand Down
11 changes: 8 additions & 3 deletions gocd/slfo-stagings.gocd.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ pipelines:
- staging-bot
tasks:
- script: |-
set -eu
export PYTHONPATH=$PWD/scripts
cd scripts/gocd
while osc -A $STAGING_API api /build/$SLFO_RING_1_PROJECT/standard/x86_64?view=status | grep 'code=' | sed -E 's/^.*code="(.*)".*$/\1/' | grep -q finished; ret=$?; [ ${ret} -ne 0 ]; do
sleep 60
done
status="$(osc -A $STAGING_API api /build/$SLFO_RING_1_PROJECT/standard/x86_64?view=status | grep 'code=' | sed -E 's/^.*code="(.*)".*$/\1/')"
echo $SLFO_RING_1_PROJECT status: "${status}"
if [ printf '%s' "${status}" | grep -q finished ]; then
exit 0
else
exit 1
fi
- Freeze.stagings:
## 6 hours (at most 30 minutes per staging)
timeout: 360
Expand Down

0 comments on commit da9a918

Please sign in to comment.