ci: add configuration for the proxy/mirror registry

This makes it possible to pull images from Docker Hub through the local
container image registry in the CI OpenShift deployment. The registry in
the CI is configured with the 'cephcsibot' account so that pulling
images is accounted towards the account, and not anonymous consumers
within the whole CentOS CI.

There should be no need to manually sync the images between the local
registry and Docker Hub anymore.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos
2020-11-23 14:20:46 +01:00
committed by mergify[bot]
parent 6a7e6c841f
commit 5ae8fb7c9b
7 changed files with 75 additions and 17 deletions

View File

@ -19,6 +19,7 @@ def ssh(cmd) {
def podman_login(registry, username, passwd) {
ssh "podman login --authfile=~/.podman-auth.json --username=${username} --password='${passwd}' ${registry}"
ssh 'cp container-registry.conf /etc/containers/registries.conf'
}
def podman_pull(registry, image) {
@ -103,7 +104,7 @@ node('cico-workspace') {
if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/merge"
}
sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh ./podman2minikube.sh root@${CICO_NODE}:'
sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh ./podman2minikube.sh container-registry.conf root@${CICO_NODE}:'
ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}"
}
stage('pull base container images') {
@ -117,7 +118,7 @@ node('cico-workspace') {
}
// base_image is like ceph/ceph:v15
podman_pull(ci_registry, "${base_image}")
podman_pull("docker.io", "${base_image}")
// cephcsi:devel is used with 'make containerized-build'
podman_pull(ci_registry, "ceph-csi:devel")
}
@ -135,7 +136,7 @@ node('cico-workspace') {
if (rook_version != '') {
// single-node-k8s.sh pushes the image into minikube
podman_pull(ci_registry, "rook/ceph:${rook_version}")
podman_pull("docker.io", "rook/ceph:${rook_version}")
}
timeout(time: 30, unit: 'MINUTES') {
@ -143,9 +144,9 @@ node('cico-workspace') {
}
// vault:latest and nginx:latest are used by the e2e tests
podman_pull(ci_registry, "vault:latest")
podman_pull("docker.io", "vault:latest")
ssh "./podman2minikube.sh vault:latest"
podman_pull(ci_registry, "nginx:latest")
podman_pull("docker.io", "nginx:latest")
ssh "./podman2minikube.sh nginx:latest"
}
stage('deploy ceph-csi through helm') {