ci: pull BASE_IMAGE from local registry

The CI scripts pull all container images from the local CI registry. If
the image name starts with "docker.io/", the images will be pushed into
the test environment as "docker.io/docker.io/ceph/ceph:v15". This image
will not be used by the tests, so things can still fail in case Docker
Hub has reached the pull rate-limit.

By dropping the additional "docker.io/" from the BASE_IMAGE name, the
image gets pushed as "docker.io/ceph/ceph:v15" so the tests will use it
automatically.

Groovy-syntax: https://www.baeldung.com/groovy-remove-string-prefix#using-regex
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-11-30 09:03:39 +01:00 committed by mergify[bot]
parent 7cac1f7609
commit a26772188a
4 changed files with 12 additions and 8 deletions

View File

@ -131,9 +131,10 @@ node('cico-workspace') {
script: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \'source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${BASE_IMAGE}\'',
returnStdout: true
).trim()
def d_io_regex = ~"^docker.io/"
// base_image is like ceph/ceph:v15
podman_pull(ci_registry, "docker.io", "${base_image}")
// base_image is like ceph/ceph:v15 or docker.io/ceph/ceph:v15, strip "docker.io/"
podman_pull(ci_registry, "docker.io", "${base_image}" - d_io_regex)
}
}
}

View File

@ -116,13 +116,14 @@ node('cico-workspace') {
script: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \'source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${BASE_IMAGE}\'',
returnStdout: true
).trim()
def d_io_regex = ~"^docker.io/"
withCredentials([usernamePassword(credentialsId: 'container-registry-auth', usernameVariable: 'CREDS_USER', passwordVariable: 'CREDS_PASSWD')]) {
podman_login(ci_registry, "${CREDS_USER}", "${CREDS_PASSWD}")
}
// base_image is like ceph/ceph:v15
podman_pull(ci_registry, "docker.io", "${base_image}")
// base_image is like ceph/ceph:v15 or docker.io/ceph/ceph:v15, strip "docker.io/"
podman_pull(ci_registry, "docker.io", "${base_image}" - d_io_regex)
// cephcsi:devel is used with 'make containerized-build'
podman_pull(ci_registry, ci_registry, "ceph-csi:devel")
}

View File

@ -113,13 +113,14 @@ node('cico-workspace') {
script: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \'source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${BASE_IMAGE}\'',
returnStdout: true
).trim()
def d_io_regex = ~"^docker.io/"
withCredentials([usernamePassword(credentialsId: 'container-registry-auth', usernameVariable: 'CREDS_USER', passwordVariable: 'CREDS_PASSWD')]) {
podman_login(ci_registry, "${CREDS_USER}", "${CREDS_PASSWD}")
}
// base_image is like ceph/ceph:v15
podman_pull(ci_registry, "docker.io", "${base_image}")
// base_image is like ceph/ceph:v15 or docker.io/ceph/ceph:v15, strip "docker.io/"
podman_pull(ci_registry, "docker.io", "${base_image}" - d_io_regex)
// cephcsi:devel is used with 'make containerized-build'
podman_pull(ci_registry, ci_registry, "ceph-csi:devel")
}

View File

@ -113,13 +113,14 @@ node('cico-workspace') {
script: 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} \'source /opt/build/go/src/github.com/ceph/ceph-csi/build.env && echo ${BASE_IMAGE}\'',
returnStdout: true
).trim()
def d_io_regex = ~"^docker.io/"
withCredentials([usernamePassword(credentialsId: 'container-registry-auth', usernameVariable: 'CREDS_USER', passwordVariable: 'CREDS_PASSWD')]) {
podman_login(ci_registry, "${CREDS_USER}", "${CREDS_PASSWD}")
}
// base_image is like ceph/ceph:v15
podman_pull(ci_registry, "docker.io", "${base_image}")
// base_image is like ceph/ceph:v15 or docker.io/ceph/ceph:v15, strip "docker.io/"
podman_pull(ci_registry, "docker.io", "${base_image}" - d_io_regex)
// cephcsi:devel is used with 'make containerized-build'
podman_pull(ci_registry, ci_registry, "ceph-csi:devel")
}