From 8b6988d46d415427771101311d870c4f1d59fe63 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 07:02:09 +0200 Subject: [PATCH 01/19] Remove individual build directories --- 1.12/Dockerfile | 17 ----------------- 1.13/Dockerfile | 17 ----------------- 1.13/docker-compose.test.yml | 5 ----- 17.03/Dockerfile | 17 ----------------- 17.03/docker-compose.test.yml | 5 ----- 17.06/Dockerfile | 17 ----------------- 17.06/docker-compose.test.yml | 5 ----- 17.09/Dockerfile | 17 ----------------- 17.09/docker-compose.test.yml | 5 ----- 17.12/Dockerfile | 17 ----------------- 17.12/docker-compose.test.yml | 5 ----- 17/Dockerfile | 17 ----------------- 17/docker-compose.test.yml | 5 ----- 18.02/Dockerfile | 17 ----------------- 18.02/docker-compose.test.yml | 5 ----- 18/Dockerfile | 17 ----------------- 18/docker-compose.test.yml | 5 ----- latest/Dockerfile => Dockerfile | 0 ...-compose.test.yml => docker-compose.test.yml | 0 latest/docker-compose.test.yml | 5 ----- 20 files changed, 198 deletions(-) delete mode 100644 1.12/Dockerfile delete mode 100644 1.13/Dockerfile delete mode 100644 1.13/docker-compose.test.yml delete mode 100644 17.03/Dockerfile delete mode 100644 17.03/docker-compose.test.yml delete mode 100644 17.06/Dockerfile delete mode 100644 17.06/docker-compose.test.yml delete mode 100644 17.09/Dockerfile delete mode 100644 17.09/docker-compose.test.yml delete mode 100644 17.12/Dockerfile delete mode 100644 17.12/docker-compose.test.yml delete mode 100644 17/Dockerfile delete mode 100644 17/docker-compose.test.yml delete mode 100644 18.02/Dockerfile delete mode 100644 18.02/docker-compose.test.yml delete mode 100644 18/Dockerfile delete mode 100644 18/docker-compose.test.yml rename latest/Dockerfile => Dockerfile (100%) rename 1.12/docker-compose.test.yml => docker-compose.test.yml (100%) delete mode 100644 latest/docker-compose.test.yml diff --git a/1.12/Dockerfile b/1.12/Dockerfile deleted file mode 100644 index 61a9783..0000000 --- a/1.12/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=1.12 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.8.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/1.13/Dockerfile b/1.13/Dockerfile deleted file mode 100644 index 24941d8..0000000 --- a/1.13/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=1.13 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.10.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/1.13/docker-compose.test.yml b/1.13/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/1.13/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/17.03/Dockerfile b/17.03/Dockerfile deleted file mode 100644 index eb4b367..0000000 --- a/17.03/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=17.03 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.11.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/17.03/docker-compose.test.yml b/17.03/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/17.03/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/17.06/Dockerfile b/17.06/Dockerfile deleted file mode 100644 index 3f19f7d..0000000 --- a/17.06/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=17.06 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.15.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/17.06/docker-compose.test.yml b/17.06/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/17.06/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/17.09/Dockerfile b/17.09/Dockerfile deleted file mode 100644 index 6ea2147..0000000 --- a/17.09/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=17.09 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.16.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/17.09/docker-compose.test.yml b/17.09/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/17.09/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/17.12/Dockerfile b/17.12/Dockerfile deleted file mode 100644 index 397eded..0000000 --- a/17.12/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=17.12 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.18.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/17.12/docker-compose.test.yml b/17.12/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/17.12/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/17/Dockerfile b/17/Dockerfile deleted file mode 100644 index af07e4b..0000000 --- a/17/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=17 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.18.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/17/docker-compose.test.yml b/17/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/17/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/18.02/Dockerfile b/18.02/Dockerfile deleted file mode 100644 index d75ac38..0000000 --- a/18.02/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=18.02 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.19.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/18.02/docker-compose.test.yml b/18.02/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/18.02/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/18/Dockerfile b/18/Dockerfile deleted file mode 100644 index db02c87..0000000 --- a/18/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG DOCKER_VERSION=18 -FROM docker:${DOCKER_VERSION} - -ARG COMPOSE_VERSION=1.19.* -ARG DOCKER_VERSION - -RUN apk add --no-cache py-pip -RUN pip install "docker-compose${COMPOSE_VERSION:+==}${COMPOSE_VERSION}" - -LABEL \ - org.opencontainers.image.authors="Tobias Maier " \ - org.opencontainers.image.description="This docker image installs docker-compose on top of the docker image." \ - org.opencontainers.image.licenses="MIT" \ - org.opencontainers.image.source="https://github.com/tmaier/docker-compose" \ - org.opencontainers.image.title="Docker Compose on docker base image" \ - org.opencontainers.image.vendor="BauCloud GmbH" \ - org.opencontainers.image.version="${DOCKER_VERSION} with docker-compose ${COMPOSE_VERSION}" diff --git a/18/docker-compose.test.yml b/18/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/18/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version diff --git a/latest/Dockerfile b/Dockerfile similarity index 100% rename from latest/Dockerfile rename to Dockerfile diff --git a/1.12/docker-compose.test.yml b/docker-compose.test.yml similarity index 100% rename from 1.12/docker-compose.test.yml rename to docker-compose.test.yml diff --git a/latest/docker-compose.test.yml b/latest/docker-compose.test.yml deleted file mode 100644 index 476f460..0000000 --- a/latest/docker-compose.test.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' -services: - sut: - image: ${IMAGE_NAME} - command: docker-compose version From 7a59c5fad881633aa913ff122204595056a58083 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 07:23:04 +0200 Subject: [PATCH 02/19] Add build and push scripts --- hooks/build | 11 +++++++++++ hooks/push | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100755 hooks/build create mode 100755 hooks/push diff --git a/hooks/build b/hooks/build new file mode 100755 index 0000000..d979609 --- /dev/null +++ b/hooks/build @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +set -e + +while read docker_version compose_version; +do + docker build \ + --build-arg DOCKER_VERSION=${docker_version} \ + --build-arg COMPOSE_VERSION=${compose_version} \ + -t $DOCKER_REPO:${docker_version} . +done < DOCKER_AND_COMPOSE_VERSION_MATRIX diff --git a/hooks/push b/hooks/push new file mode 100755 index 0000000..c7a50bb --- /dev/null +++ b/hooks/push @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +set -e + +images=`docker image ls ${DOCKER_REPO} --format "{{.Repository}}:{{.Tag}}"`; + +for image in ${images}; +do + docker image push ${image} +done From b3fc0e335f3bcff91556f4a95371f803c5593988 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 07:25:05 +0200 Subject: [PATCH 03/19] Add DOCKER_AND_COMPOSE_VERSION_MATRIX --- DOCKER_AND_COMPOSE_VERSION_MATRIX | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 DOCKER_AND_COMPOSE_VERSION_MATRIX diff --git a/DOCKER_AND_COMPOSE_VERSION_MATRIX b/DOCKER_AND_COMPOSE_VERSION_MATRIX new file mode 100644 index 0000000..16ed21d --- /dev/null +++ b/DOCKER_AND_COMPOSE_VERSION_MATRIX @@ -0,0 +1,9 @@ +1.12 1.8.* +1.13 1.10.* +17 1.18.* +17.03 1.11.* +17.06 1.15.* +17.09 1.16.* +17.12 1.18.* +18 1.19.* +18.02 1.19.* From 3702ceb4b4d0b44768004832d19994a00d998d39 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 07:28:01 +0200 Subject: [PATCH 04/19] Add test hook --- hooks/test | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 hooks/test diff --git a/hooks/test b/hooks/test new file mode 100755 index 0000000..64c81a3 --- /dev/null +++ b/hooks/test @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +set -e + +images=`docker image ls ${DOCKER_REPO} --format "{{.Repository}}:{{.Tag}}"`; + +for image in ${images}; +do + export IMAGE_NAME=${image}; + docker-compose -f docker-compose.test.yml --rm run sut +done From e12ce4e9edfa9162d32f76b50615d593ca17737f Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 17:25:01 +0200 Subject: [PATCH 05/19] Add note in README Document DOCKER_AND_COMPOSE_VERSION_MATRIX --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 19ee27a..c1d9a34 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ There are versions based on different docker versions, e.g. `latest`, `17.06`, ` docker-compose matches the latest minor version available when the docker release was made. Eg, `17.06` includes docker-compose 1.15.0. The `latest` tag always includes the latest docker-compose build. +All available Docker Engine versions and the respective Docker Compose versions are defined in [`DOCKER_AND_COMPOSE_VERSION_MATRIX`](./DOCKER_AND_COMPOSE_VERSION_MATRIX). + Please open an issue or a pull request (preferred) [at GitHub](https://github.com/tmaier/docker-compose), if a version is missing. ## Usage instructions for GitLab CI From d8736a5795d7dab50cfd7083570ba0e7c5fa0ab1 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 17:29:44 +0200 Subject: [PATCH 06/19] Improve shell syntax ShellCheck syntax errors SC2006, SC2162, SC2086 --- hooks/build | 8 ++++---- hooks/push | 4 ++-- hooks/test | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hooks/build b/hooks/build index d979609..335c540 100755 --- a/hooks/build +++ b/hooks/build @@ -2,10 +2,10 @@ set -e -while read docker_version compose_version; +while read -r docker_version compose_version; do docker build \ - --build-arg DOCKER_VERSION=${docker_version} \ - --build-arg COMPOSE_VERSION=${compose_version} \ - -t $DOCKER_REPO:${docker_version} . + --build-arg DOCKER_VERSION="${docker_version}" \ + --build-arg COMPOSE_VERSION="${compose_version}" \ + -t "${DOCKER_REPO}:${docker_version}" . done < DOCKER_AND_COMPOSE_VERSION_MATRIX diff --git a/hooks/push b/hooks/push index c7a50bb..239b2a0 100755 --- a/hooks/push +++ b/hooks/push @@ -2,9 +2,9 @@ set -e -images=`docker image ls ${DOCKER_REPO} --format "{{.Repository}}:{{.Tag}}"`; +images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); for image in ${images}; do - docker image push ${image} + docker image push "${image}" done diff --git a/hooks/test b/hooks/test index 64c81a3..942cae4 100755 --- a/hooks/test +++ b/hooks/test @@ -2,7 +2,7 @@ set -e -images=`docker image ls ${DOCKER_REPO} --format "{{.Repository}}:{{.Tag}}"`; +images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); for image in ${images}; do From 9dc6c3ffc6dd450148ffbd678e2ccc020dfdf490 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 17:37:39 +0200 Subject: [PATCH 07/19] Add echos of different stages --- hooks/build | 1 + hooks/push | 1 + hooks/test | 1 + 3 files changed, 3 insertions(+) diff --git a/hooks/build b/hooks/build index 335c540..f81805c 100755 --- a/hooks/build +++ b/hooks/build @@ -4,6 +4,7 @@ set -e while read -r docker_version compose_version; do + echo "# Building image ${image}..." docker build \ --build-arg DOCKER_VERSION="${docker_version}" \ --build-arg COMPOSE_VERSION="${compose_version}" \ diff --git a/hooks/push b/hooks/push index 239b2a0..3938e5d 100755 --- a/hooks/push +++ b/hooks/push @@ -6,5 +6,6 @@ images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); for image in ${images}; do + echo "# Pushing image ${image}..." docker image push "${image}" done diff --git a/hooks/test b/hooks/test index 942cae4..d9e46da 100755 --- a/hooks/test +++ b/hooks/test @@ -6,6 +6,7 @@ images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); for image in ${images}; do + echo "# Testing image ${image}..." export IMAGE_NAME=${image}; docker-compose -f docker-compose.test.yml --rm run sut done From 646cb9ca88c2147342f767532a0241e3a3f74843 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 17:37:49 +0200 Subject: [PATCH 08/19] Introduce image variable in build hook --- hooks/build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/build b/hooks/build index f81805c..6f4172e 100755 --- a/hooks/build +++ b/hooks/build @@ -5,8 +5,9 @@ set -e while read -r docker_version compose_version; do echo "# Building image ${image}..." + image=${DOCKER_REPO}:${docker_version} docker build \ --build-arg DOCKER_VERSION="${docker_version}" \ --build-arg COMPOSE_VERSION="${compose_version}" \ - -t "${DOCKER_REPO}:${docker_version}" . + -t "${image}" . done < DOCKER_AND_COMPOSE_VERSION_MATRIX From 02fe44c579ea3d5cce2fe79866bf106fec8a81d0 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 17:38:45 +0200 Subject: [PATCH 09/19] Prepare for debugging --- DOCKER_AND_COMPOSE_VERSION_MATRIX | 7 ------- hooks/push | 1 + hooks/test | 1 + 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/DOCKER_AND_COMPOSE_VERSION_MATRIX b/DOCKER_AND_COMPOSE_VERSION_MATRIX index 16ed21d..3f99dfd 100644 --- a/DOCKER_AND_COMPOSE_VERSION_MATRIX +++ b/DOCKER_AND_COMPOSE_VERSION_MATRIX @@ -1,9 +1,2 @@ 1.12 1.8.* 1.13 1.10.* -17 1.18.* -17.03 1.11.* -17.06 1.15.* -17.09 1.16.* -17.12 1.18.* -18 1.19.* -18.02 1.19.* diff --git a/hooks/push b/hooks/push index 3938e5d..0cb772a 100755 --- a/hooks/push +++ b/hooks/push @@ -8,4 +8,5 @@ for image in ${images}; do echo "# Pushing image ${image}..." docker image push "${image}" + echo "Exit code: $?" done diff --git a/hooks/test b/hooks/test index d9e46da..8dd1b45 100755 --- a/hooks/test +++ b/hooks/test @@ -9,4 +9,5 @@ do echo "# Testing image ${image}..." export IMAGE_NAME=${image}; docker-compose -f docker-compose.test.yml --rm run sut + echo "Exit code: $?" done From bdc358886ac1ddf51c80cf39b2d4ee58208936e6 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 17:41:20 +0200 Subject: [PATCH 10/19] Fix order --- hooks/build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/build b/hooks/build index 6f4172e..73523fb 100755 --- a/hooks/build +++ b/hooks/build @@ -4,8 +4,9 @@ set -e while read -r docker_version compose_version; do - echo "# Building image ${image}..." image=${DOCKER_REPO}:${docker_version} + echo "# Building image ${image}..." + docker build \ --build-arg DOCKER_VERSION="${docker_version}" \ --build-arg COMPOSE_VERSION="${compose_version}" \ From 4b29dce360ba55502540823f19486d3c8a8f40ee Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:03:24 +0200 Subject: [PATCH 11/19] Add more debug code --- hooks/push | 2 ++ hooks/test | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/hooks/push b/hooks/push index 0cb772a..17ba781 100755 --- a/hooks/push +++ b/hooks/push @@ -2,6 +2,8 @@ set -e +docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}" + images=$(docker image ls "${DOCKER_REPO}" --format "{{.Repository}}:{{.Tag}}"); for image in ${images}; diff --git a/hooks/test b/hooks/test index 8dd1b45..1099a90 100755 --- a/hooks/test +++ b/hooks/test @@ -2,6 +2,10 @@ 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}; From 04d5b013f3344762eaf3b06d17464dbf31ae0337 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:12:01 +0200 Subject: [PATCH 12/19] 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 From 4792cc9f2d4b8d1bb1e1ada34f4368190096d078 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:34:06 +0200 Subject: [PATCH 13/19] Fix docker-compose run command --- hooks/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/test b/hooks/test index fc6602a..c90222c 100755 --- a/hooks/test +++ b/hooks/test @@ -10,5 +10,5 @@ do echo "# Testing image ${image}..." export IMAGE_NAME=${image}; - docker-compose -f docker-compose.test.yml --rm run sut + docker-compose -f docker-compose.test.yml run --rm sut done < DOCKER_AND_COMPOSE_VERSION_MATRIX From f203228e70e9a137ff5766b5d8ce059c5d3cc542 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:34:14 +0200 Subject: [PATCH 14/19] Remove debug code --- hooks/push | 1 - hooks/test | 2 -- 2 files changed, 3 deletions(-) diff --git a/hooks/push b/hooks/push index d20cd43..d0df618 100755 --- a/hooks/push +++ b/hooks/push @@ -2,7 +2,6 @@ set -e - while read -r docker_version compose_version; do image=${DOCKER_REPO}:${docker_version} diff --git a/hooks/test b/hooks/test index c90222c..d9e7a7f 100755 --- a/hooks/test +++ b/hooks/test @@ -2,8 +2,6 @@ set -e -echo "Test Hook is starting" - while read -r docker_version compose_version; do image=${DOCKER_REPO}:${docker_version} From 66f17aa16ba93e96004d0f620f75622ffa1f53ef Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:38:07 +0200 Subject: [PATCH 15/19] Revert "Prepare for debugging" This reverts commit 02fe44c579ea3d5cce2fe79866bf106fec8a81d0. --- DOCKER_AND_COMPOSE_VERSION_MATRIX | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DOCKER_AND_COMPOSE_VERSION_MATRIX b/DOCKER_AND_COMPOSE_VERSION_MATRIX index 3f99dfd..16ed21d 100644 --- a/DOCKER_AND_COMPOSE_VERSION_MATRIX +++ b/DOCKER_AND_COMPOSE_VERSION_MATRIX @@ -1,2 +1,9 @@ 1.12 1.8.* 1.13 1.10.* +17 1.18.* +17.03 1.11.* +17.06 1.15.* +17.09 1.16.* +17.12 1.18.* +18 1.19.* +18.02 1.19.* From 07035e327e57d4136f725f9525fb3496d56a5706 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:43:19 +0200 Subject: [PATCH 16/19] Always attempt to pull a newer version of the image --- hooks/build | 1 + 1 file changed, 1 insertion(+) diff --git a/hooks/build b/hooks/build index 73523fb..7c42e68 100755 --- a/hooks/build +++ b/hooks/build @@ -10,5 +10,6 @@ do docker build \ --build-arg DOCKER_VERSION="${docker_version}" \ --build-arg COMPOSE_VERSION="${compose_version}" \ + --pull \ -t "${image}" . done < DOCKER_AND_COMPOSE_VERSION_MATRIX From 548911cd353d2f4c042224e23ccd5ed754742013 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 18:44:46 +0200 Subject: [PATCH 17/19] Use set -ex in hooks --- hooks/build | 2 +- hooks/push | 2 +- hooks/test | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hooks/build b/hooks/build index 7c42e68..9b6f10f 100755 --- a/hooks/build +++ b/hooks/build @@ -1,6 +1,6 @@ #!/usr/bin/env sh -set -e +set -ex while read -r docker_version compose_version; do diff --git a/hooks/push b/hooks/push index d0df618..61eb4c4 100755 --- a/hooks/push +++ b/hooks/push @@ -1,6 +1,6 @@ #!/usr/bin/env sh -set -e +set -ex while read -r docker_version compose_version; do diff --git a/hooks/test b/hooks/test index d9e7a7f..0443bf7 100755 --- a/hooks/test +++ b/hooks/test @@ -1,6 +1,6 @@ #!/usr/bin/env sh -set -e +set -ex while read -r docker_version compose_version; do From 66499c954f92332ca7a2a2dcb981c064857269fb Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 19:35:22 +0200 Subject: [PATCH 18/19] compose_version not used in test and push hooks --- hooks/push | 2 +- hooks/test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/push b/hooks/push index 61eb4c4..3fba919 100755 --- a/hooks/push +++ b/hooks/push @@ -2,7 +2,7 @@ set -ex -while read -r docker_version compose_version; +while read -r docker_version _; do image=${DOCKER_REPO}:${docker_version} echo "# Pushing image ${image}..." diff --git a/hooks/test b/hooks/test index 0443bf7..207fc75 100755 --- a/hooks/test +++ b/hooks/test @@ -2,7 +2,7 @@ set -ex -while read -r docker_version compose_version; +while read -r docker_version _; do image=${DOCKER_REPO}:${docker_version} echo "# Testing image ${image}..." From 821ba49d8a15f359e9ef65db172d6fc60a5a57f7 Mon Sep 17 00:00:00 2001 From: "Tobias L. Maier" Date: Sun, 29 Apr 2018 19:35:40 +0200 Subject: [PATCH 19/19] 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