summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-12-25 23:46:26 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2017-12-25 23:59:29 +0100
commit5e3bf15dfd827c41d6a52ad40711a8ec0fbe42f7 (patch)
tree46efc8e3e8791f35a7e3d06decf700105d7f2741
parentf9e71426234fb0303b937d63cfa0020d4b24a267 (diff)
Clean base images only if 1 container was built
Conflicts: build.sh Change-Id: I0134082d2d150a6dc58e679f9ade81eb6c040266 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 20d22666aa841f0128b3f53a07ba0f31684537d8)
-rw-r--r--build.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index ff582f195..064f3a326 100644
--- a/build.sh
+++ b/build.sh
@@ -20,9 +20,9 @@ find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core:euphrates|${repo}
for dir in ${amd64_dirs}; do
(cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:amd64-euphrates" .)
docker push "${repo}/functest-${dir##**/}:amd64-euphrates"
- [ "${dir}" != "docker/core" ] && docker rmi "${repo}/functest-${dir##**/}:amd64-euphrates" || true
+ [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:amd64-euphrates" || true)
done
-docker rmi "${repo}/functest-core:amd64-euphrates" alpine:3.6 || true
+[ ! -z "${amd64_dirs}" ] && (docker rmi "${repo}/functest-core:amd64-euphrates" alpine:3.6 || true)
find . -name Dockerfile -exec git checkout {} +
find . -name Dockerfile -exec sed -i -e "s|alpine:3.6|multiarch/alpine:arm64-v3.6|g" {} +
@@ -30,9 +30,9 @@ find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core:euphrates|${repo}
for dir in ${arm64_dirs}; do
(cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:arm64-euphrates" .)
docker push "${repo}/functest-${dir##**/}:arm64-euphrates"
- [ "${dir}" != "docker/core" ] && docker rmi "${repo}/functest-${dir##**/}:arm64-euphrates" || true
+ [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:arm64-euphrates" || true)
done
-docker rmi "${repo}/functest-core:arm64-euphrates" multiarch/alpine:arm64-v3.6 || true
+[ ! -z "${arm64_dirs}" ] && (docker rmi "${repo}/functest-core:arm64-euphrates" multiarch/alpine:arm64-v3.6 || true)
find . -name Dockerfile -exec git checkout {} +
exit $?