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 15:45:24 +02:00
parent 94791de0e5
commit 64ff73b722
Signed by untrusted user: gleidi
GPG Key ID: DE9BE0ACE8246F08
2 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -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