From 9c4009bd1499a8a161f1a90dbfc5264575cba1ca Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 3 Nov 2020 09:23:15 +0100 Subject: [PATCH] ci: pass BASE_IMAGE to "oc start-build" Because the parallel steps, the build.env is not in the local directory where the command is executed. So fetch the BASE_IMAGE before continuing with 'oc start-build', and pass the name of the image on the commandline. Signed-off-by: Niels de Vos --- jobs/build-images.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jobs/build-images.yaml b/jobs/build-images.yaml index 62ce864f0..2340e1a8c 100644 --- a/jobs/build-images.yaml +++ b/jobs/build-images.yaml @@ -19,14 +19,21 @@ git url: "${GIT_REPO}", branch: "${GIT_BRANCH}", changelog: false } stage('build images') { + def base_image = sh(script: 'source ${WORKSPACE}/build.env && echo ${BASE_IMAGE}', + returnStdout: true).trim() parallel canary: { - sh 'source build.env && oc start-build --follow --build-arg=BASE_IMAGE="${BASE_IMAGE}" --build-arg=GO_ARCH=amd64 ceph-csi-canary' + sh "oc start-build --follow \ + --build-arg=BASE_IMAGE='${base_image}' \ + --build-arg=GO_ARCH=amd64 \ + ceph-csi-canary" }, test: { sh 'oc start-build --follow ceph-csi-test' }, devel: { - sh 'source build.env && oc start-build --follow --build-arg=BASE_IMAGE="${BASE_IMAGE}" ceph-csi-devel' + sh "oc start-build --follow \ + --build-arg=BASE_IMAGE='${base_image}' \ + ceph-csi-devel" } } }