From b1784013088067186a9afe7e7e956d383da0a7ff Mon Sep 17 00:00:00 2001 From: Mantra Date: Thu, 7 Nov 2024 15:38:34 +0000 Subject: [PATCH] proper smoke test --- .github/workflows/build.yml | 3 +-- scripts/smoke-test.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 scripts/smoke-test.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af060e0d..d7bac2b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,7 @@ jobs: tags: | ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_SHA}} ghcr.io/${{env.TAG_GHCR}}:${{steps.ci-env.outputs.CI_BRANCH}} - - name: Smoke test run: | ./scripts/run-version.sh --app ${{steps.ci-env.outputs.CI_BRANCH}} & - curl http://localhost:3000 | grep "Example WODIN configuration" + ./scripts/smoke-test.sh diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh new file mode 100755 index 00000000..f8be9a95 --- /dev/null +++ b/scripts/smoke-test.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +retries=10 +sleep 5; + +while ((retries > 0)); do + curl http://localhost:3000 | grep "Example WODIN configuration" && break + + echo "retrying connection with server in 1 seconds" + sleep 1 + ((retries --)) +done + +if ((retries == 0 )); then + echo "Didn't get expected response from the server" + exit 1 +fi