From 5918fa65fe88a028d786ff697169b9c52bd95e9e Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Tue, 28 Jan 2020 23:13:26 -0500 Subject: [PATCH] Add healthcheck to webapp (#294) --- .env | 2 +- docker/integtest/0-wait-for-services.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 9db500b2..f690d5a9 100644 --- a/.env +++ b/.env @@ -11,7 +11,7 @@ LOKOLE_EMAIL_SERVER_QUEUES_SAS_KEY= LOKOLE_EMAIL_SERVER_QUEUES_NAMESPACE= LOKOLE_SENDGRID_KEY= REGISTRATION_CREDENTIALS=admin:password -WEBAPP_VERSION=0.5.6 +WEBAPP_VERSION=0.5.8 CLOUDBROWSER_PORT=10001 AZURITE_PORT=10000 diff --git a/docker/integtest/0-wait-for-services.sh b/docker/integtest/0-wait-for-services.sh index 36dd179e..a1e5b4b9 100755 --- a/docker/integtest/0-wait-for-services.sh +++ b/docker/integtest/0-wait-for-services.sh @@ -73,7 +73,23 @@ wait_for_api() { exit 4 } +wait_for_webapp() { + local i + + for i in $(seq 1 "${max_retries}"); do + if curl -fs "http://nginx:8888/web/healthcheck/ping" >/dev/null; then + log "Webapp is running" + return + fi + log "Waiting for webapp (${i}/${max_retries})" + sleep "${polling_interval_seconds}s" + done + + exit 4 +} + wait_for_rabbitmq wait_for_postgres wait_for_appinsights wait_for_api +wait_for_webapp