From fd85ffb2053267297f7a777a936946aaee7b77c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Ollivier?= Date: Thu, 3 Aug 2017 09:56:20 +0200 Subject: [PATCH] Switch to Docker post_checkout hooks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Automated builds work when Dockerfile is modified after checkout. Otherwise they are not triggered [1]. [1] https://github.com/docker/hub-feedback/issues/518 Change-Id: I6ba9e06f9e62011d2f1c1788f2647b1175842ef3 Signed-off-by: Cédric Ollivier --- docker/components/hooks/build | 7 ------- docker/components/hooks/post_checkout | 6 ++++++ docker/features/hooks/build | 7 ------- docker/features/hooks/post_checkout | 6 ++++++ docker/healthcheck/hooks/build | 7 ------- docker/healthcheck/hooks/post_checkout | 6 ++++++ docker/smoke/hooks/build | 7 ------- docker/smoke/hooks/post_checkout | 6 ++++++ 8 files changed, 24 insertions(+), 28 deletions(-) delete mode 100644 docker/components/hooks/build create mode 100644 docker/components/hooks/post_checkout delete mode 100644 docker/features/hooks/build create mode 100644 docker/features/hooks/post_checkout delete mode 100644 docker/healthcheck/hooks/build create mode 100644 docker/healthcheck/hooks/post_checkout delete mode 100644 docker/smoke/hooks/build create mode 100644 docker/smoke/hooks/post_checkout diff --git a/docker/components/hooks/build b/docker/components/hooks/build deleted file mode 100644 index e5d15b526..000000000 --- a/docker/components/hooks/build +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -from="${DOCKER_REPO%/*}/functest-core" -sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile && - docker build -t "${IMAGE_NAME}" . - -exit $? diff --git a/docker/components/hooks/post_checkout b/docker/components/hooks/post_checkout new file mode 100644 index 000000000..20a6d4b95 --- /dev/null +++ b/docker/components/hooks/post_checkout @@ -0,0 +1,6 @@ +#!/bin/bash + +from="${DOCKER_REPO%/*}/functest-core" +sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile + +exit $? diff --git a/docker/features/hooks/build b/docker/features/hooks/build deleted file mode 100644 index e5d15b526..000000000 --- a/docker/features/hooks/build +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -from="${DOCKER_REPO%/*}/functest-core" -sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile && - docker build -t "${IMAGE_NAME}" . - -exit $? diff --git a/docker/features/hooks/post_checkout b/docker/features/hooks/post_checkout new file mode 100644 index 000000000..20a6d4b95 --- /dev/null +++ b/docker/features/hooks/post_checkout @@ -0,0 +1,6 @@ +#!/bin/bash + +from="${DOCKER_REPO%/*}/functest-core" +sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile + +exit $? diff --git a/docker/healthcheck/hooks/build b/docker/healthcheck/hooks/build deleted file mode 100644 index e5d15b526..000000000 --- a/docker/healthcheck/hooks/build +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -from="${DOCKER_REPO%/*}/functest-core" -sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile && - docker build -t "${IMAGE_NAME}" . - -exit $? diff --git a/docker/healthcheck/hooks/post_checkout b/docker/healthcheck/hooks/post_checkout new file mode 100644 index 000000000..20a6d4b95 --- /dev/null +++ b/docker/healthcheck/hooks/post_checkout @@ -0,0 +1,6 @@ +#!/bin/bash + +from="${DOCKER_REPO%/*}/functest-core" +sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile + +exit $? diff --git a/docker/smoke/hooks/build b/docker/smoke/hooks/build deleted file mode 100644 index e5d15b526..000000000 --- a/docker/smoke/hooks/build +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -from="${DOCKER_REPO%/*}/functest-core" -sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile && - docker build -t "${IMAGE_NAME}" . - -exit $? diff --git a/docker/smoke/hooks/post_checkout b/docker/smoke/hooks/post_checkout new file mode 100644 index 000000000..20a6d4b95 --- /dev/null +++ b/docker/smoke/hooks/post_checkout @@ -0,0 +1,6 @@ +#!/bin/bash + +from="${DOCKER_REPO%/*}/functest-core" +sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile + +exit $? -- 2.16.6