Add script to build all containers 15/37215/6
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 11 Jul 2017 21:53:36 +0000 (23:53 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Mon, 17 Jul 2017 01:07:38 +0000 (03:07 +0200)
It also sets opnfv as default repository as they will be pushed by
releng.

It adds hooks asked for automated build via Docker which allows
continuous integration before the update of jjobs.

Change-Id: I08b55b1ff334afe6c0f58af3100cfa04f76d8ef0
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
build.sh [new file with mode: 0644]
docker/healthcheck/Dockerfile
docker/healthcheck/hooks/build [new file with mode: 0644]
docker/smoke/Dockerfile
docker/smoke/hooks/build [new file with mode: 0644]

diff --git a/build.sh b/build.sh
new file mode 100644 (file)
index 0000000..dbc79e0
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+
+repo=${repo:-opnfv}
+
+(cd docker && docker build -t "${repo}/functest" .)
+docker push "${repo}/functest"
+
+for dir in docker/core docker/healthcheck docker/smoke; do
+    (cd ${dir} && docker build -t "${repo}/functest-${dir##**/}" .)
+    docker push "${repo}/functest-${dir##**/}"
+done
+
+exit $?
index 6dfea7f..8923e4c 100644 (file)
@@ -1,4 +1,4 @@
-FROM ollivier/functest-core
+FROM opnfv/functest-core
 
 COPY testcases.yaml /usr/lib/python2.7/site-packages/functest/ci/testcases.yaml
 CMD ["bash","-c","prepare_env start && run_tests -t all"]
diff --git a/docker/healthcheck/hooks/build b/docker/healthcheck/hooks/build
new file mode 100644 (file)
index 0000000..e5d15b5
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile &&
+    docker build -t "${IMAGE_NAME}" .
+
+exit $?
index b6f84b6..15ab702 100644 (file)
@@ -1,4 +1,4 @@
-FROM ollivier/functest-core
+FROM opnfv/functest-core
 
 ARG BRANCH=master
 ARG OPENSTACK_TAG=stable/ocata
diff --git a/docker/smoke/hooks/build b/docker/smoke/hooks/build
new file mode 100644 (file)
index 0000000..e5d15b5
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-core"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile &&
+    docker build -t "${IMAGE_NAME}" .
+
+exit $?