Skip to content

Commit

Permalink
Reorg: verify (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
the1bit authored Dec 7, 2023
1 parent 4cbc095 commit 820dc62
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions scripts/verify-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,28 @@
echo "Checking status of POST Jobs for Eventing-Manager"

REF_NAME="${1:-"main"}"
# Generate job Status URL
STATUS_URL="https://api.github.com/repos/kyma-project/eventing-manager/commits/${REF_NAME}/status"
fullstatus=`curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" ${STATUS_URL} | head -n 2 `

sleep 10
# Wait for job result
sleep 30

# Get status result
statusresult=`curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" ${STATUS_URL}`
# Get overall state
fullstatus=$(echo $statusresult | jq '.state' | tr -d '"')

# Show overall state to user
echo $fullstatus

if [[ "$fullstatus" == *"success"* ]]; then
# Check state
if [[ $fullstatus == "success" ]]; then
# Job: success
echo "All jobs succeeded"
else
# Job: failed or pending
echo "Jobs failed or pending - Check Prow status"
# Show job(s) details
echo $statusresult | jq '.statuses[]'
exit 1
fi

0 comments on commit 820dc62

Please sign in to comment.