From 04d5b013f3344762eaf3b06d17464dbf31ae0337 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:12:01 +0200 Subject: [PATCH] Use DOCKER_AND_COMPOSE_VERSION_MATRIX also in push and test hooks --- hooks/push | 10 ++++------ hooks/test | 11 ++++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/hooks/push b/hooks/push index 17ba781..d20cd43 100755 --- a/hooks/push +++ b/hooks/push @@ -2,13 +2,11 @@ set -e -docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}" -images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); - -for image in ${images}; +while read -r docker_version compose_version; do + image=${DOCKER_REPO}:${docker_version} echo "# Pushing image ${image}..." + docker image push "${image}" - echo "Exit code: $?" -done +done < DOCKER_AND_COMPOSE_VERSION_MATRIX diff --git a/hooks/test b/hooks/test index 1099a90..fc6602a 100755 --- a/hooks/test +++ b/hooks/test @@ -4,14 +4,11 @@ set -e echo "Test Hook is starting" -docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}" - -images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); - -for image in ${images}; +while read -r docker_version compose_version; do + image=${DOCKER_REPO}:${docker_version} echo "# Testing image ${image}..." export IMAGE_NAME=${image}; + docker-compose -f docker-compose.test.yml --rm run sut - echo "Exit code: $?" -done +done < DOCKER_AND_COMPOSE_VERSION_MATRIX