X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=build.sh;h=ec5f06544a3b47f8eb5aef6513e02b721929606e;hb=83961346e79e291e96a7178d81a74e117aefd76f;hp=9f0542b1a227a8d3490c9f7acba4b228d6faa178;hpb=0911abc82403066af66d285db739cff03772b06c;p=functest.git diff --git a/build.sh b/build.sh index 9f0542b1a..ec5f06544 100644 --- a/build.sh +++ b/build.sh @@ -5,17 +5,26 @@ set -e repo=${REPO:-opnfv} amd64_dirs=${amd64_dirs-"\ docker/core \ +docker/tempest \ docker/healthcheck \ docker/smoke \ +docker/benchmarking \ docker/features \ -docker/components \ -docker/vnf \ -docker/parser"} +docker/vnf"} +arm_dirs=${arm_dirs-"\ +docker/core \ +docker/tempest \ +docker/healthcheck \ +docker/smoke \ +docker/benchmarking \ +docker/features"} arm64_dirs=${arm64_dirs-${amd64_dirs}} -build_opts=(--pull=true --no-cache --force-rm=true) +build_opts=("--pull=true" --no-cache "--force-rm=true") find . -name Dockerfile -exec sed -i \ -e "s|opnfv/functest-core|${repo}/functest-core:amd64-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-tempest|${repo}/functest-tempest:amd64-latest|g" {} + for dir in ${amd64_dirs}; do (cd "${dir}" && docker build "${build_opts[@]}" \ @@ -24,14 +33,16 @@ for dir in ${amd64_dirs}; do [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:amd64-latest" || true) done -[ ! -z "${amd64_dirs}" ] && - (docker rmi "${repo}/functest-core:amd64-latest" alpine:3.7 || true) +[ -n "${amd64_dirs}" ] && + (docker rmi "${repo}/functest-core:amd64-latest" alpine:3.10 || true) find . -name Dockerfile -exec git checkout {} + find . -name Dockerfile -exec sed -i \ - -e "s|alpine:3.7|multiarch/alpine:arm64-v3.7|g" {} + + -e "s|alpine:3.10|multiarch/alpine:arm64-v3.10|g" {} + find . -name Dockerfile -exec sed -i \ -e "s|opnfv/functest-core|${repo}/functest-core:arm64-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-tempest|${repo}/functest-tempest:arm64-latest|g" {} + for dir in ${arm64_dirs}; do (cd "${dir}" && docker build "${build_opts[@]}" \ -t "${repo}/functest-${dir##**/}:arm64-latest" .) @@ -39,9 +50,27 @@ for dir in ${arm64_dirs}; do [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:arm64-latest" || true) done -[ ! -z "${arm64_dirs}" ] && +[ -n "${arm64_dirs}" ] && (docker rmi "${repo}/functest-core:arm64-latest" \ - multiarch/alpine:arm64-v3.7 || true) + multiarch/alpine:arm64-v3.10 || true) +find . -name Dockerfile -exec git checkout {} + + +find . -name Dockerfile -exec sed -i \ + -e "s|alpine:3.10|multiarch/alpine:armhf-v3.10|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-core|${repo}/functest-core:arm-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-tempest|${repo}/functest-tempest:arm-latest|g" {} + +for dir in ${arm_dirs}; do + (cd "${dir}" && docker build "${build_opts[@]}" \ + -t "${repo}/functest-${dir##**/}:arm-latest" .) + docker push "${repo}/functest-${dir##**/}:arm-latest" + [ "${dir}" != "docker/core" ] && + (docker rmi "${repo}/functest-${dir##**/}:arm-latest" || true) +done +[ -n "${arm_dirs}" ] && + (docker rmi "${repo}/functest-core:arm-latest" \ + multiarch/alpine:armhf-v3.10 || true) find . -name Dockerfile -exec git checkout {} + exit $?