Commit e6937bda authored by Albert Salim's avatar Albert Salim

Merge branch 'alberts-fix-retry-url' into 'master'

Fix verify deployment retries

See merge request gitlab-org/gitlab!63715
parents 7af87dc3 b95eca3f
......@@ -367,7 +367,7 @@ EOF
function verify_deploy() {
echoinfo "Verifying deployment at ${CI_ENVIRONMENT_URL}"
if wait_for_url "${CI_ENVIRONMENT_URL}" curl_output.txt; then
if retry "test_url \"${CI_ENVIRONMENT_URL}\" curl_output.txt"; then
echoinfo "Review app is deployed to ${CI_ENVIRONMENT_URL}"
return 0
else
......
......@@ -13,16 +13,18 @@ function retry() {
return 1
}
function wait_for_url() {
function test_url() {
local url="${1}"
local curl_output="${2}"
local status
echo "Waiting for ${url}"
status=$(curl -s -o "${curl_output}" -L -w ''%{http_code}'' "${url}")
timeout -s 1 60 bash -c \
'while [[ "$(curl -s -o ${1} -L -w ''%{http_code}'' ${0})" != "200" ]]; \
do echo "." && sleep 5; \
done' ${url} ${curl_output}
if [[ $status == "200" ]]; then
return 0
fi
return 1
}
function bundle_install_script() {
......
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