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-"\
18 arm_dirs=${arm_dirs-${amd64_dirs}}
19 arm64_dirs=${arm64_dirs-${amd64_dirs}}
22 build_opts=(--pull=true --no-cache --force-rm=true)
24 for arch in ${arch}; do
25 if [[ ${arch} == arm64 ]]; then
26 find . -name Dockerfile -exec sed -i \
27 -e "s|alpine:3.14|arm64v8/alpine:3.14|g" {} +
28 find . -name Dockerfile -exec sed -i \
29 -e "s|opnfv/xtesting|${repo}/xtesting:arm64-${tag}|g" {} +
30 elif [[ ${arch} == arm ]]; then
31 find . -name Dockerfile -exec sed -i \
32 -e "s|alpine:3.14|arm32v6/alpine:3.14|g" {} +
33 find . -name Dockerfile -exec sed -i \
34 -e "s|opnfv/xtesting|${repo}/xtesting:arm-${tag}|g" {} +
36 find . -name Dockerfile -exec sed -i \
37 -e "s|opnfv/xtesting|${repo}/xtesting:amd64-${tag}|g" {} +
40 for dir in ${!dirs}; do
41 if [[ ${dir} == docker/core ]]; then
44 image=xtesting-${dir##**/}
47 docker build "${build_opts[@]}" \
48 -t "${repo}/${image}:${arch}-${tag}" . &&
49 docker push "${repo}/${image}:${arch}-${tag}")
50 [ "${dir}" != "docker/core" ] &&
52 "${repo}/${image}:${arch}-${tag}" || true)
55 (sudo docker rmi "${repo}/xtesting:${arch}-${tag}"|| true)
56 find . -name Dockerfile -exec git checkout \{\} +;