Switch to Docker post_checkout hooks 67/38667/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 3 Aug 2017 07:56:20 +0000 (09:56 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 3 Aug 2017 08:01:27 +0000 (10:01 +0200)
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 <cedric.ollivier@orange.com>
docker/components/hooks/build [deleted file]
docker/components/hooks/post_checkout [new file with mode: 0644]
docker/features/hooks/build [deleted file]
docker/features/hooks/post_checkout [new file with mode: 0644]
docker/healthcheck/hooks/build [deleted file]
docker/healthcheck/hooks/post_checkout [new file with mode: 0644]
docker/smoke/hooks/build [deleted file]
docker/smoke/hooks/post_checkout [new file with mode: 0644]

diff --git a/docker/components/hooks/build b/docker/components/hooks/build
deleted file mode 100644 (file)
index e5d15b5..0000000
+++ /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 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -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 (file)
index e5d15b5..0000000
+++ /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 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -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 (file)
index e5d15b5..0000000
+++ /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 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -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 (file)
index e5d15b5..0000000
+++ /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 (file)
index 0000000..20a6d4b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?