diff options
author | Jingzhao Ni <jingzhao.ni@arm.com> | 2018-08-17 16:58:58 +0800 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-08-17 14:49:44 +0200 |
commit | facb16007f238d5bf633436f16b4d737990dacc7 (patch) | |
tree | 00316b31fa8c1e200cef5d9a1bf862bff5f88fde | |
parent | d1a1e7e92053d767e8322d17370a8700562b44a0 (diff) |
Add some build option in build.sh for supporting arm arch
In build.sh, add some build options for arm arch.
It also updates constraints to OpenStack Queens.
Co-Authored-By: Cédric Ollivier <cedric.ollivier@orange.com>
Change-Id: I3cc6c10e2e52c281e2324d8b42b721383be30c0b
Signed-off-by: Jingzhao Ni <jingzhao.ni@arm.com>
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit a540530c66dbd78b83554e22064728c7c03801ea)
-rw-r--r-- | build.sh | 44 |
1 files changed, 34 insertions, 10 deletions
@@ -8,24 +8,48 @@ docker/core \ docker/healthcheck \ docker/smoke \ docker/features"} +arm64_dirs=${arm64_dirs-${amd64_dirs}} build_opts=(--pull=true --no-cache --force-rm=true) find . -name Dockerfile -exec sed -i \ - -e "s|opnfv/functest-kubernetes-core:fraser|\ -${repo}/functest-kubernetes-core:fraser|g" {} + + -e "s|opnfv/functest-kubernetes-core|\ +${repo}/functest-kubernetes-core:amd64-fraser|g" {} + find . -name Dockerfile -exec sed -i \ - -e "s|opnfv/functest-kubernetes-healthcheck:fraser|\ -${repo}/functest-kubernetes-healthcheck:fraser|g" {} + + -e "s|opnfv/functest-kubernetes-healthcheck|\ +${repo}/functest-kubernetes-healthcheck:amd64-fraser|g" {} + for dir in ${amd64_dirs}; do - (cd "${dir}" && docker build "${build_opts[@]}" \ - -t "${repo}/functest-kubernetes-${dir##**/}:fraser" .) - docker push "${repo}/functest-kubernetes-${dir##**/}:fraser" + (cd "${dir}" && + docker build "${build_opts[@]}" \ + -t "${repo}/functest-kubernetes-${dir##**/}:amd64-fraser" .) + docker push "${repo}/functest-kubernetes-${dir##**/}:amd64-fraser" [ "${dir}" != "docker/core" ] && - (docker rmi "${repo}/functest-kubernetes-${dir##**/}:fraser" || true) + (docker rmi \ + "${repo}/functest-kubernetes-${dir##**/}:amd64-fraser" || true) done [ ! -z "${amd64_dirs}" ] && - (docker rmi "${repo}/functest-kubernetes-healthcheck:fraser" \ - "${repo}/functest-kubernetes-core:fraser" alpine:3.7 || true) + (docker rmi \ + "${repo}/functest-kubernetes-core:amd64-fraser" alpine:3.7 || true) +find . -name Dockerfile -exec git checkout {} + + +find . -name Dockerfile -exec sed -i \ + -e "s|alpine:3.7|multiarch/alpine:arm64-v3.7|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-kubernetes-core|\ +${repo}/functest-kubernetes-core:arm64-fraser|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-kubernetes-healthcheck|\ +${repo}/functest-kubernetes-healthcheck:arm64-fraser|g" {} + +for dir in ${arm64_dirs}; do + (cd "${dir}" && docker build "${build_opts[@]}" \ + -t "${repo}/functest-kubernetes-${dir##**/}:arm64-fraser" .) + docker push "${repo}/functest-kubernetes-${dir##**/}:arm64-fraser" + [ "${dir}" != "docker/core" ] && + (docker rmi \ + "${repo}/functest-kubernetes-${dir##**/}:arm64-fraser" || true) +done +[ ! -z "${arm64_dirs}" ] && + (docker rmi "${repo}/functest-kubernetes-core:arm64-fraser" \ + multiarch/alpine:arm64-v3.7 || true) find . -name Dockerfile -exec git checkout {} + exit $? |