Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

Commit

Permalink
Add retries to _build Deployment Verification job (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Oct 31, 2022
1 parent fc65285 commit df98fa2
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,27 @@ jobs:
if: steps.get-route.outputs.route &&( inputs.penetration_test != 'true' )
run: |
# Curl URL and verify http code 200
# Vars
URL="${{ steps.get-route.outputs.route }}"
if [ $(curl -ILso /dev/null -w "%{http_code}" "${URL}") -ne 200 ]
then
HTTP_CODE=$(curl -ILso /dev/null -w "%{http_code}" "${URL}")
echo -e "Failure! \n\tStatus = ${HTTP_CODE} \n\tURL: ${URL}\n"
exit 1
fi
echo -e "Deployment successful!"
[ -z "${URL}"] || echo "URL: ${URL}"
RETRIES=2
# Info
echo -e "\n${URL}\n"
# Curl and verify
while [ ${RETRIES} -gt 0 ]; do
HTTP_CODE=$(curl -ILso /dev/null -w "%{http_code}" "${URL}")
if [ "${HTTP_CODE}" -eq 200 ]; then
echo -e "Deployment successful!"
exit
fi
echo -e "\nHTTP_CODE:${HTTP_CODE}, RETRIES:${RETRIES}"
RETRIES=$((RETRIES-1))
sleep 10
done
echo -e "\nDeployment verification failed"
exit 1
- name: Penetration Test
if: steps.get-route.outputs.route &&( inputs.penetration_test == 'true' )
Expand Down

0 comments on commit df98fa2

Please sign in to comment.