Commit 94271657 authored by Albert Salim's avatar Albert Salim

Verify deployment is successful

parent 7234f19d
......@@ -71,13 +71,16 @@ review-deploy:
- download_chart
- date
- deploy || (display_deployment_debug && exit 1)
- verify_deploy || exit 1
- disable_sign_ups || (delete_release && exit 1)
after_script:
# Run seed-dast-test-data.sh only when DAST_RUN is set to true. This is to pupulate review app with data for DAST scan.
# Set DAST_RUN to true when jobs are manually scheduled.
- if [ "$DAST_RUN" == "true" ]; then source scripts/review_apps/seed-dast-test-data.sh; TRACE=1 trigger_proj_user_creation; fi
artifacts:
paths: [environment_url.txt]
paths:
- environment_url.txt
- curl_output.txt
expire_in: 7 days
when: always
......
......@@ -365,6 +365,20 @@ EOF
eval "${HELM_CMD}"
}
function verify_deploy() {
echoinfo "Verifying deployment at ${CI_ENVIRONMENT_URL}"
local status=$(curl -sL -w "%{http_code}\\n" "${CI_ENVIRONMENT_URL}" -o curl_output.txt)
if [[ $status == '200' ]]; then
echoinfo "Review app is deployed to ${CI_ENVIRONMENT_URL}"
return 0
else
echoerr "Review app is not available at ${CI_ENVIRONMENT_URL}. See curl_output.txt artifact for detail."
return 1
fi
}
function display_deployment_debug() {
local namespace="${CI_ENVIRONMENT_SLUG}"
local release="${CI_ENVIRONMENT_SLUG}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment