From 4aee922b3fe1d115720e6b70f56e09490ab366f7 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Tue, 6 Feb 2024 09:59:30 +0100 Subject: [PATCH] fix(deps): error out if compose up fails typically happens when network ports are in use. Previously it would just hang waiting for a non-started service to go healthy. --- CHANGELOG.md | 4 ++++ pongo.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9d978c0..92fcead3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ older images after a Pongo upgrade. A new image will automatically be build now. [#516](https://github.com/Kong/kong-pongo/pull/516). +* Fix: fail if the compose-up command fails. To prevent hanging while waiting for a + health-check to go healthy. + [#522](https://github.com/Kong/kong-pongo/pull/522). + * Fix: do not fail the build if httpie cannot be installed. Now continues the build since it is optional. [#515](https://github.com/Kong/kong-pongo/pull/515). diff --git a/pongo.sh b/pongo.sh index 1cb04d02..3eadb2be 100755 --- a/pongo.sh +++ b/pongo.sh @@ -694,7 +694,7 @@ function ensure_available { fi if [[ ! $? -eq 0 ]]; then msg "auto-starting the test environment, use the 'pongo down' action to stop it" - compose_up + compose_up || err "failed to start the test environment" fi local dependency @@ -845,7 +845,7 @@ function pongo_clean { function pongo_expose { local dependency="expose" - healthy "$(cid "$dependency")" "$dependency" || compose up -d "$dependency" + healthy "$(cid "$dependency")" "$dependency" || compose up -d "$dependency" || err "failed to start '$dependency'" wait_for_dependency "$dependency" }