X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=build.sh;h=033d313103856b462c549aee1543dfb58bbf5778;hb=b9fedb6868306a6e3145b7ee851ea3a84353df9c;hp=ec5f06544a3b47f8eb5aef6513e02b721929606e;hpb=fa8f32f2d4919ac83a00ea8012a7f0de0de9241c;p=functest.git diff --git a/build.sh b/build.sh index ec5f06544..033d31310 100644 --- a/build.sh +++ b/build.sh @@ -1,50 +1,50 @@ -#!/bin/bash +#!/bin/sh set -e repo=${REPO:-opnfv} amd64_dirs=${amd64_dirs-"\ docker/core \ -docker/tempest \ docker/healthcheck \ docker/smoke \ docker/benchmarking \ -docker/features \ -docker/vnf"} -arm_dirs=${arm_dirs-"\ -docker/core \ -docker/tempest \ -docker/healthcheck \ -docker/smoke \ -docker/benchmarking \ -docker/features"} +docker/vnf \ +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-tempest|${repo}/functest-tempest:amd64-latest|g" {} + + -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[@]}" \ + 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 [ -n "${amd64_dirs}" ] && - (docker rmi "${repo}/functest-core:amd64-latest" alpine:3.10 || true) + (docker rmi "${repo}/functest-core:amd64-latest" alpine:3.16 || true) find . -name Dockerfile -exec git checkout {} + find . -name Dockerfile -exec sed -i \ - -e "s|alpine:3.10|multiarch/alpine:arm64-v3.10|g" {} + + -e "s|alpine:3.16|arm64v8/alpine:3.16|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" {} + + -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[@]}" \ + (cd "${dir}" && docker build $build_opts \ -t "${repo}/functest-${dir##**/}:arm64-latest" .) docker push "${repo}/functest-${dir##**/}:arm64-latest" [ "${dir}" != "docker/core" ] && @@ -52,17 +52,20 @@ for dir in ${arm64_dirs}; do done [ -n "${arm64_dirs}" ] && (docker rmi "${repo}/functest-core:arm64-latest" \ - multiarch/alpine:arm64-v3.10 || true) + arm64v8/alpine:3.16 || true) find . -name Dockerfile -exec git checkout {} + find . -name Dockerfile -exec sed -i \ - -e "s|alpine:3.10|multiarch/alpine:armhf-v3.10|g" {} + + -e "s|alpine:3.16|arm32v6/alpine:3.16|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" {} + + -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[@]}" \ + (cd "${dir}" && docker build $build_opts \ -t "${repo}/functest-${dir##**/}:arm-latest" .) docker push "${repo}/functest-${dir##**/}:arm-latest" [ "${dir}" != "docker/core" ] && @@ -70,7 +73,7 @@ for dir in ${arm_dirs}; do done [ -n "${arm_dirs}" ] && (docker rmi "${repo}/functest-core:arm-latest" \ - multiarch/alpine:armhf-v3.10 || true) + arm32v6/alpine:3.16 || true) find . -name Dockerfile -exec git checkout {} + exit $?