From e6b70c494ef2604bf45d45e1810aba46a9ce6ec7 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 2 Mar 2021 14:52:07 +0100 Subject: [PATCH] ci: prevent parallel builds from causing conflicts When the container image needs to be rebuild, two parallel jobs will try to attempt that. With recent versions of Podman, this now fails. When the image needs to be rebuild, do so in the stage where it would otherwise get pulled. This makes sure the image gets build only once. Signed-off-by: Niels de Vos --- containerized-tests.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/containerized-tests.groovy b/containerized-tests.groovy index 364247ca1..6d08f55dd 100644 --- a/containerized-tests.groovy +++ b/containerized-tests.groovy @@ -108,6 +108,8 @@ node('cico-workspace') { if (rebuild_test_container == 10) { // container needs rebuild, don't pull use_test_image = 'USE_PULLED_IMAGE=no' + // build the test image + ssh "cd /opt/build/go/src/github.com/ceph/ceph-csi && make CONTAINER_CMD=podman ENV_CSI_IMAGE_NAME=${ci_registry}/${cached_image} .test-container-id" return } @@ -119,6 +121,8 @@ node('cico-workspace') { if (rebuild_devel_container == 10) { // container needs rebuild, don't pull use_build_image = 'USE_PULLED_IMAGE=no' + // build the devel image + ssh "cd /opt/build/go/src/github.com/ceph/ceph-csi && make CONTAINER_CMD=podman ENV_CSI_IMAGE_NAME=${ci_registry}/${cached_image} .devel-container-id" return }