X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=build.sh;h=effd075006aec761a6585200a3cce5f208508dac;hb=42dfaae910733c2a02f0ffe986a2d9d78ec0cd78;hp=929f71f1b7f164b94a196f49193efd4c92a0fc3f;hpb=3b54b935c9171891a86d3b7b3bf98eac776ad259;p=functest.git diff --git a/build.sh b/build.sh index 929f71f1b..effd07500 100644 --- a/build.sh +++ b/build.sh @@ -2,36 +2,78 @@ set -e -repo=${repo:-opnfv} +repo=${REPO:-opnfv} amd64_dirs=${amd64_dirs-"\ docker/core \ docker/healthcheck \ docker/smoke \ -docker/features \ -docker/components \ +docker/benchmarking \ docker/vnf \ -docker/parser \ -docker/restapi"} +docker/smoke-cntt \ +docker/benchmarking-cntt"} +arm_dirs=${arm_dirs-${amd64_dirs}} 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-core|${repo}/functest-core:amd64-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-smoke|${repo}/functest-smoke:amd64-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-benchmarking|\ +${repo}/functest-benchmarking:amd64-latest|g" {} + for dir in ${amd64_dirs}; do - (cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:amd64-latest" .) - docker push "${repo}/functest-${dir##**/}:amd64-latest" - [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:amd64-latest" || true) + (cd "${dir}" && + docker build "${build_opts[@]}" \ + -t "${repo}/functest-${dir##**/}:amd64-latest" .) + docker push "${repo}/functest-${dir##**/}:amd64-latest" + [ "${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.13 || 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-core|${repo}/functest-core:arm64-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|alpine:3.13|arm64v8/alpine:3.13|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-smoke|${repo}/functest-smoke:arm64-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-benchmarking|\ +${repo}/functest-benchmarking:arm64-latest|g" {} + for dir in ${arm64_dirs}; do - (cd "${dir}" && docker build "${build_opts[@]}" -t "${repo}/functest-${dir##**/}:arm64-latest" .) + (cd "${dir}" && docker build "${build_opts[@]}" \ + -t "${repo}/functest-${dir##**/}:arm64-latest" .) docker push "${repo}/functest-${dir##**/}:arm64-latest" - [ "${dir}" != "docker/core" ] && (docker rmi "${repo}/functest-${dir##**/}:arm64-latest" || true) + [ "${dir}" != "docker/core" ] && + (docker rmi "${repo}/functest-${dir##**/}:arm64-latest" || true) done -[ ! -z "${arm64_dirs}" ] && (docker rmi "${repo}/functest-core:arm64-latest" multiarch/alpine:arm64-v3.7 || true) +[ -n "${arm64_dirs}" ] && + (docker rmi "${repo}/functest-core:arm64-latest" \ + arm64v8/alpine:3.13 || true) +find . -name Dockerfile -exec git checkout {} + + +find . -name Dockerfile -exec sed -i \ + -e "s|alpine:3.13|arm32v6/alpine:3.13|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-smoke|${repo}/functest-smoke:arm-latest|g" {} + +find . -name Dockerfile -exec sed -i \ + -e "s|opnfv/functest-benchmarking|\ +${repo}/functest-benchmarking: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" \ + arm32v6/alpine:3.13 || true) find . -name Dockerfile -exec git checkout {} + exit $?