Add python3.6-dev
[functest-xtesting.git] / build.sh
1 #!/bin/bash
2
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
7
8 set -xe
9
10 repo=${REPO:-opnfv}
11 tag=${BRANCH:-hunter}
12 arch=${arch-"\
13 amd64 \
14 arm64 \
15 arm"}
16 image="xtesting"
17 build_opts=(--pull=true --no-cache --force-rm=true)
18
19 for arch in ${arch};do
20     if [[ ${arch} == arm64 ]]; then
21         find . -name Dockerfile -exec sed -i \
22             -e "s|alpine:3.9|multiarch/alpine:arm64-v3.9|g" {} +
23     elif [[ ${arch} == arm ]]; then
24         find . -name Dockerfile -exec sed -i \
25             -e "s|alpine:3.9|multiarch/alpine:armhf-v3.9|g" {} +
26     fi
27     (cd docker &&   docker build "${build_opts[@]}" \
28         -t "${repo}/${image}:${arch}-${tag}" .)
29     docker push "${repo}/${image}:${arch}-${tag}"
30     [ "$?" == "0" ] &&
31         (sudo docker rmi "${repo}/${image}:${arch}-${tag}"|| true)
32     find . -name Dockerfile -exec git checkout \{\} +;
33 done
34 exit $?