Do not use cache when building the image
[functest.git] / build.sh
1 #!/bin/bash
2
3 set -e
4
5 repo=${repo:-opnfv}
6 amd64_dirs=${amd64_dirs-"\
7 docker/core \
8 docker/healthcheck \
9 docker/smoke \
10 docker/features \
11 docker/components \
12 docker/vnf \
13 docker/parser \
14 docker/restapi"}
15 arm64_dirs=${arm64_dirs-$(echo "${amd64_dirs}" | sed -e "s|docker/vnf||" \
16     -e "s|docker/restapi||")}
17
18 find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core|${repo}/functest-core:amd64-latest|g" {} +
19 for dir in ${amd64_dirs}; do
20     (cd "${dir}" && docker build --no-cache -t "${repo}/functest-${dir##**/}:amd64-latest" .)
21     docker push "${repo}/functest-${dir##**/}:amd64-latest"
22 done
23 find . -name Dockerfile -exec git checkout {} +
24
25 find . -name Dockerfile -exec sed -i -e "s|alpine:3.6|multiarch/alpine:arm64-v3.6|g" {} +
26 find . -name Dockerfile -exec sed -i -e "s|opnfv/functest-core|${repo}/functest-core:arm64-latest|g" {} +
27 for dir in ${arm64_dirs}; do
28     (cd "${dir}" && docker build --no-cache -t "${repo}/functest-${dir##**/}:arm64-latest" .)
29     docker push "${repo}/functest-${dir##**/}:arm64-latest"
30 done
31 find . -name Dockerfile -exec git checkout {} +
32
33 exit $?