ci: correctly fetch BASE_IMAGE from build.env

The BASE_IMAGE variable was not stored in the variable so that the CI
job can consume it. By using sh(), this should be the case now.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-11-17 11:04:31 +01:00 committed by mergify[bot]
parent b5123e6134
commit 3c82db25e3

View File

@ -96,7 +96,10 @@ node('cico-workspace') {
ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}"
}
stage('pull base container images') {
def base_image = ssh 'source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${BASE_IMAGE}'
def base_image = sh(
script: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${BASE_IMAGE}"',
returnStdout: true
).trim()
withCredentials([usernamePassword(credentialsId: 'container-registry-auth', usernameVariable: 'CREDS_USER', passwordVariable: 'CREDS_PASSWD')]) {
ssh "podman login --username=${CREDS_USER} --password='${CREDS_PASSWD}' ${ci_registry}"