Skip to content

Commit

Permalink
Update gradle-check script to wait for workflow_url to be ready
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon committed Sep 4, 2024
1 parent f6564ca commit e07e004
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/gradle/gradle-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ echo "wait for jenkins to start workflow" && sleep 15

echo "Check if queue exist in Jenkins after triggering"
if [ -z "$QUEUE_URL" ] || [ "$QUEUE_URL" != "null" ]; then
while [ "$TIMEPASS" -le "$TIMEOUT" ]; do
while [ "$RESULT" == "null" ] && [ "$TIMEPASS" -le "$TIMEOUT" ]; do
WORKFLOW_URL=$(curl -s -XGET ${JENKINS_URL}/${QUEUE_URL}api/json | jq --raw-output .executable.url)
echo WORKFLOW_URL $WORKFLOW_URL

Expand Down Expand Up @@ -95,6 +95,7 @@ if [ -z "$QUEUE_URL" ] || [ "$QUEUE_URL" != "null" ]; then

else
echo "Job not started yet. Waiting for 60 seconds before next attempt."
TIMEPASS=$(( TIMEPASS + 60 )) && echo time pass: $TIMEPASS
sleep 60
fi
done
Expand Down

0 comments on commit e07e004

Please sign in to comment.