From 92f6c83d1906253ba4127954548b0fb89877dad8 Mon Sep 17 00:00:00 2001 From: Marco Wettstein <maw@panter.ch> Date: Thu, 8 Apr 2021 14:31:09 +0200 Subject: [PATCH] fix: only check for 503 as some endpoints might not return 200 --- .gitlab-ci.yml | 2 +- includes/verify.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 969ce96..17f1f1e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -include: +include: - project: gitlab-ci/semantic-release ref: v1 file: semantic-release-base.yml diff --git a/includes/verify.yml b/includes/verify.yml index 880a573..60507ec 100644 --- a/includes/verify.yml +++ b/includes/verify.yml @@ -6,9 +6,9 @@ return 1 } - statusIs200 () { + statusIsNot503 () { statusCode=$(curl --write-out '%{http_code}' --silent --output /dev/null $CI_ENVIRONMENT_URL) - if [[ "$statusCode" == "200" ]]; then return 0; fi + if [[ "$statusCode" != "503" ]]; then return 0; fi echo "statuscode is $statusCode" return 1 } @@ -17,7 +17,7 @@ counter=0 echo "check if new version has been deployed successfully" echo "checking $CI_ENVIRONMENT_URL" - until buildIdMatches && statusIs200 + until buildIdMatches && statusIsNot503 do sleep 1 [[ counter -eq $max_retry ]] && echo "Failed!"" && exit 1 -- GitLab