3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
15 amd64_dirs=${amd64_dirs-"\
17 arm_dirs=${arm_dirs-${amd64_dirs}}
18 arm64_dirs=${arm64_dirs-${amd64_dirs}}
21 build_opts=(--pull=true --no-cache --force-rm=true)
23 for arch in ${arch}; do
24 if [[ ${arch} == arm64 ]]; then
25 find . -name Dockerfile -exec sed -i \
26 -e "s|alpine:3.17|arm64v8/alpine:3.17|g" {} +
27 find . -name Dockerfile -exec sed -i \
28 -e "s|opnfv/xtesting|${repo}/xtesting:arm64-${tag}|g" {} +
29 elif [[ ${arch} == arm ]]; then
30 find . -name Dockerfile -exec sed -i \
31 -e "s|alpine:3.17|arm32v6/alpine:3.17|g" {} +
32 find . -name Dockerfile -exec sed -i \
33 -e "s|opnfv/xtesting|${repo}/xtesting:arm-${tag}|g" {} +
35 find . -name Dockerfile -exec sed -i \
36 -e "s|opnfv/xtesting|${repo}/xtesting:amd64-${tag}|g" {} +
39 for dir in ${!dirs}; do
40 if [[ ${dir} == docker/core ]]; then
43 image=xtesting-${dir##**/}
46 docker build "${build_opts[@]}" \
47 -t "${repo}/${image}:${arch}-${tag}" . &&
48 docker push "${repo}/${image}:${arch}-${tag}")
49 [ "${dir}" != "docker/core" ] &&
51 "${repo}/${image}:${arch}-${tag}" || true)
54 (sudo docker rmi "${repo}/xtesting:${arch}-${tag}"|| true)
55 find . -name Dockerfile -exec git checkout \{\} +;