From 821ba49d8a15f359e9ef65db172d6fc60a5a57f7 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 19:35:40 +0200 Subject: [PATCH] Fix loop of test --- hooks/test | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hooks/test b/hooks/test index 207fc75..1e7f047 100755 --- a/hooks/test +++ b/hooks/test @@ -6,7 +6,14 @@ while read -r docker_version _; do image=${DOCKER_REPO}:${docker_version} echo "# Testing image ${image}..." - export IMAGE_NAME=${image}; + export IMAGE_NAME="${image}" - docker-compose -f docker-compose.test.yml run --rm sut + container=$(docker-compose -f docker-compose.test.yml run -d sut) + + if [ "$(docker container wait "${container}")" != "0" ] + then + echo "Test of ${IMAGE_NAME} failed" + exit 1 + fi + docker-compose -f docker-compose.test.yml rm --force sut done < DOCKER_AND_COMPOSE_VERSION_MATRIX