aboutsummaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2020-08-10 21:40:11 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2020-08-11 10:29:29 +0200
commit3c4543a8ef6f84a5f25483a6dfe50e0075a9cd0e (patch)
treecbd718b0a676d46d5aa47a411e9478d3608df53e /build.sh
parente4f32ecf5777e24e0898ee65f6c1c4c27c647dc5 (diff)
Compile all Functest K8s containers for arm v7 and v8
It removes sudo when useless and turns debug on when compiling K8s binaries. It avoids TravisCI timeouts (No output has been received)[1] [1] https://travis-ci.org/github/collivier/functest-kubernetes/jobs/716819529 Change-Id: I4719257596bf9a6510e2f772271b336847d1ccb5 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index c5f8eeb5..ac5acfce 100644
--- a/build.sh
+++ b/build.sh
@@ -9,6 +9,7 @@ docker/healthcheck \
docker/smoke \
docker/cnf \
docker/security"}
+arm_dirs=${arm_dirs-${amd64_dirs}}
arm64_dirs=${arm64_dirs-${amd64_dirs}}
build_opts=(--pull=true --no-cache --force-rm=true)
@@ -54,4 +55,25 @@ done
arm64v8/golang:1.14-alpine3.12 || true)
find . -name Dockerfile -exec git checkout {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|golang:1.14-alpine3.12|arm32v7/golang:1.14-alpine3.12|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|opnfv/functest-kubernetes-core|\
+${repo}/functest-kubernetes-core:arm-latest|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|opnfv/functest-kubernetes-healthcheck|\
+${repo}/functest-kubernetes-healthcheck:arm-latest|g" {} +
+for dir in ${arm_dirs}; do
+ (cd "${dir}" && docker build "${build_opts[@]}" \
+ -t "${repo}/functest-kubernetes-${dir##**/}:arm-latest" .)
+ docker push "${repo}/functest-kubernetes-${dir##**/}:arm-latest"
+ [ "${dir}" != "docker/core" ] &&
+ (docker rmi \
+ "${repo}/functest-kubernetes-${dir##**/}:arm-latest" || true)
+done
+[ ! -z "${arm_dirs}" ] &&
+ (docker rmi "${repo}/functest-kubernetes-core:arm-latest" \
+ arm32v7/golang:1.14-alpine3.12 || true)
+find . -name Dockerfile -exec git checkout {} +
+
exit $?