Merge pull request #3154 from gleidi-suse/fix_auto_freeze

gocd: slfo-stagings: Avoid busy waiting for 50 minutes, instead rely on scheduling from GoCD.
This commit is contained in:
Giacomo Leidi 2024-09-04 17:01:20 +02:00 committed by GitHub
commit da9a918d00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 6 deletions

View File

@ -24,11 +24,16 @@ pipelines:
- staging-bot - staging-bot
tasks: tasks:
- script: |- - script: |-
set -eu
export PYTHONPATH=$PWD/scripts export PYTHONPATH=$PWD/scripts
cd scripts/gocd 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 status="$(osc -A $STAGING_API api /build/$SLFO_RING_1_PROJECT/standard/x86_64?view=status | grep 'code=' | sed -E 's/^.*code="(.*)".*$/\1/')"
sleep 60 echo $SLFO_RING_1_PROJECT status: "${status}"
done if [ printf '%s' "${status}" | grep -q finished ]; then
exit 0
else
exit 1
fi
- Freeze.stagings: - Freeze.stagings:
## 6 hours (at most 30 minutes per staging) ## 6 hours (at most 30 minutes per staging)
timeout: 360 timeout: 360

View File

@ -25,11 +25,16 @@ pipelines:
- staging-bot - staging-bot
tasks: tasks:
- script: |- - script: |-
set -eu
export PYTHONPATH=$PWD/scripts export PYTHONPATH=$PWD/scripts
cd scripts/gocd 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 status="$(osc -A $STAGING_API api /build/$SLFO_RING_1_PROJECT/standard/x86_64?view=status | grep 'code=' | sed -E 's/^.*code="(.*)".*$/\1/')"
sleep 60 echo $SLFO_RING_1_PROJECT status: "${status}"
done if [ printf '%s' "${status}" | grep -q finished ]; then
exit 0
else
exit 1
fi
- Freeze.stagings: - Freeze.stagings:
## 6 hours (at most 30 minutes per staging) ## 6 hours (at most 30 minutes per staging)
timeout: 360 timeout: 360