Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validate status code during deploy check
Browse files Browse the repository at this point in the history
hahn-kev committed May 22, 2024
1 parent de193d7 commit 1ae9111
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -118,11 +118,12 @@ jobs:
curl -s --head "$TARGET" > response.txt
# get version from response, trim off the header and fix the line endings
versionHeader=$((grep "lexbox-version" response.txt || echo VersionNotFound) | cut -d' ' -f 2 | tr -d '[:space:]')
if [[ "$versionHeader" == "$EXPECTED_VERSION" ]]; then
echo "Version is correct"
status_code=$(grep -oP "HTTP\/\d(\.\d)? \K\d+" response.txt)
if [[ "$versionHeader" == "$EXPECTED_VERSION" && "$status_code" == "200" ]]; then
echo "Version and status code are correct"
exit 0
else
echo "Version '$versionHeader' is incorrect, expected '$EXPECTED_VERSION'"
echo "Health check failed, Version '$versionHeader', expected '$EXPECTED_VERSION', status code '$status_code'"
n=$((n+1))
sleep $((DelayMultiplier * n))
fi

0 comments on commit 1ae9111

Please sign in to comment.