diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2018-03-09 09:45:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-09 09:45:29 +0000 |
commit | ff2dd12dd98abeb65b8bcf7c36a49ca9036a3850 (patch) | |
tree | 679b905c0d873444da603e494341f9abacfb50fd | |
parent | a04a201551fadc5bc130a9037b100c0e18f3c043 (diff) | |
parent | 9541cccdf6a7d50234e8670df3b5b1ee9e50c839 (diff) |
Merge "Add build.sh for functest-xtesting"
-rw-r--r-- | build.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100644 index 00000000..b78f1086 --- /dev/null +++ b/build.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + +set -xe + +repo=${REPO:-opnfv} +tag=${BRANCH:-latest} +arch=${arch_tag-"\ +amd64 \ +arm64"} +image="xtesting" +build_opts=(--pull=true --no-cache --force-rm=true) + +for arch in ${arch};do + if [[ ${arch} == arm64 ]]; then + find . -name Dockerfile -exec sed -i -e "s|alpine:3.7|multiarch/alpine:arm64-v3.7|g" {} + + fi + (cd docker && docker build "${build_opts[@]}" -t "${repo}/${image}:${arch}-${tag}" .) + docker push "${repo}/${image}:${arch}-${tag}" + [ "$?" == "0" ] && (sudo docker rmi "${repo}/${image}:${arch}-${tag}"|| true) + find . -name Dockerfile -exec git checkout \{\} +; +done +exit $? |