change count increments
This commit is contained in:
parent
0bc024dda1
commit
b0c8f2f969
1 changed files with 6 additions and 3 deletions
9
.github/workflows/update.yml
vendored
9
.github/workflows/update.yml
vendored
|
|
@ -126,7 +126,9 @@ jobs:
|
||||||
max_attempts=60 # 30 minutes (30 * 2 minutes)
|
max_attempts=60 # 30 minutes (30 * 2 minutes)
|
||||||
attempt=0
|
attempt=0
|
||||||
build_status="unknown"
|
build_status="unknown"
|
||||||
|
set -e # Exit immediately if a command exits with a non-zero status
|
||||||
while [ $attempt -lt $max_attempts ]; do
|
while [ $attempt -lt $max_attempts ]; do
|
||||||
|
echo "Attempt $((attempt + 1))/$max_attempts"
|
||||||
response=$(curl -s -H "Cookie: hydra_session=$SESSION_COOKIE" \
|
response=$(curl -s -H "Cookie: hydra_session=$SESSION_COOKIE" \
|
||||||
"${{ env.HYDRA_INSTANCE }}/api/jobsets?project=${{ env.HYDRA_PROJECT }}")
|
"${{ env.HYDRA_INSTANCE }}/api/jobsets?project=${{ env.HYDRA_PROJECT }}")
|
||||||
jobset=$(echo "$response" | jq -r '.[] | select(.name == "${{ env.HYDRA_JOBSET }}")')
|
jobset=$(echo "$response" | jq -r '.[] | select(.name == "${{ env.HYDRA_JOBSET }}")')
|
||||||
|
|
@ -134,7 +136,7 @@ jobs:
|
||||||
if [ -z "$jobset" ]; then
|
if [ -z "$jobset" ]; then
|
||||||
echo "Jobset ${{ env.HYDRA_JOBSET }} not found. Waiting..."
|
echo "Jobset ${{ env.HYDRA_JOBSET }} not found. Waiting..."
|
||||||
sleep 120
|
sleep 120
|
||||||
((attempt++))
|
attempt=$((attempt + 1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -149,7 +151,7 @@ jobs:
|
||||||
nrtotal=$(echo "$jobset" | jq -r '.nrtotal')
|
nrtotal=$(echo "$jobset" | jq -r '.nrtotal')
|
||||||
echo "nrtotal passed"
|
echo "nrtotal passed"
|
||||||
|
|
||||||
echo "Attempt $((attempt+1))/$max_attempts: nrscheduled=$nrscheduled, nrfailed=$nrfailed, nrsucceeded=$nrsucceeded, nrtotal=$nrtotal"
|
echo "Status: nrscheduled=$nrscheduled, nrfailed=$nrfailed, nrsucceeded=$nrsucceeded, nrtotal=$nrtotal"
|
||||||
|
|
||||||
if [ "$nrtotal" = "0" ]; then
|
if [ "$nrtotal" = "0" ]; then
|
||||||
echo "Build not started yet. Waiting..."
|
echo "Build not started yet. Waiting..."
|
||||||
|
|
@ -167,7 +169,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 120 # Wait for 2 minutes before checking again
|
sleep 120 # Wait for 2 minutes before checking again
|
||||||
((attempt++))
|
attempt=$((attempt + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$build_status" = "unknown" ]; then
|
if [ "$build_status" = "unknown" ]; then
|
||||||
|
|
@ -178,6 +180,7 @@ jobs:
|
||||||
echo "BUILD_SUCCESS=$([ "$build_status" = "succeeded" ] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
|
echo "BUILD_SUCCESS=$([ "$build_status" = "succeeded" ] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
|
||||||
if [ "$build_status" = "succeeded" ]; then
|
if [ "$build_status" = "succeeded" ]; then
|
||||||
echo "Build succeeded!"
|
echo "Build succeeded!"
|
||||||
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Build failed or timed out."
|
echo "Build failed or timed out."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue