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 <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-03-02 14:52:07 +01:00 committed by mergify[bot]
parent 1c2974d49e
commit e6b70c494e

View File

@ -108,6 +108,8 @@ node('cico-workspace') {
if (rebuild_test_container == 10) { if (rebuild_test_container == 10) {
// container needs rebuild, don't pull // container needs rebuild, don't pull
use_test_image = 'USE_PULLED_IMAGE=no' 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 return
} }
@ -119,6 +121,8 @@ node('cico-workspace') {
if (rebuild_devel_container == 10) { if (rebuild_devel_container == 10) {
// container needs rebuild, don't pull // container needs rebuild, don't pull
use_build_image = 'USE_PULLED_IMAGE=no' 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 return
} }