ci: move podman2minikube() into its own script

This way, it can easier be re-used for other container images.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-11-18 08:52:18 +01:00 committed by mergify[bot]
parent e4339fea72
commit dd10e66a98
6 changed files with 20 additions and 16 deletions

View File

@ -92,7 +92,7 @@ node('cico-workspace') {
if (params.ghprbPullId != null) { if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/head" ref = "pull/${ghprbPullId}/head"
} }
sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh ./run-k8s-external-storage-e2e.sh root@${CICO_NODE}:' sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh podman2minikube.sh ./run-k8s-external-storage-e2e.sh root@${CICO_NODE}:'
ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}" ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}"
} }
stage('build artifacts') { stage('build artifacts') {

View File

@ -103,7 +103,7 @@ node('cico-workspace') {
if (params.ghprbPullId != null) { if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/merge" ref = "pull/${ghprbPullId}/merge"
} }
sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh root@${CICO_NODE}:' sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh ./podman2minikube.sh root@${CICO_NODE}:'
ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}" ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}"
} }
stage('pull base container images') { stage('pull base container images') {

View File

@ -100,7 +100,7 @@ node('cico-workspace') {
if (params.ghprbPullId != null) { if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/merge" ref = "pull/${ghprbPullId}/merge"
} }
sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh root@${CICO_NODE}:' sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh ./podman2minikube.sh root@${CICO_NODE}:'
ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}" ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}"
} }
stage('pull base container images') { stage('pull base container images') {

15
podman2minikube.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
#
# When an image was built with podman, it needs importing into minikube.
#
# fail when a command returns an error
set -e -o pipefail
# "minikube ssh" fails to read the image, so use standard ssh instead
podman image save "${1}" | \
ssh \
-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
-l docker -i "$(minikube ssh-key)" \
"$(minikube ip)" docker image load

View File

@ -121,24 +121,13 @@ function deploy_rook()
${GOPATH}/src/github.com/ceph/ceph-csi/scripts/install-snapshot.sh install ${GOPATH}/src/github.com/ceph/ceph-csi/scripts/install-snapshot.sh install
} }
# When an image was built with podman, it needs importing into minikube.
function podman2minikube()
{
# "minikube ssh" fails to read the image, so use standard ssh instead
podman image save "${1}" | \
ssh \
-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no \
-l docker -i "$(minikube ssh-key)" \
"$(minikube ip)" docker image load
}
# Set environment variables # Set environment variables
set_env set_env
# prepare minikube environment # prepare minikube environment
install_minikube install_minikube
podman2minikube "quay.io/cephcsi/cephcsi:${CSI_IMAGE_VERSION}" ./podman2minikube.sh "quay.io/cephcsi/cephcsi:${CSI_IMAGE_VERSION}"
deploy_rook deploy_rook

View File

@ -100,7 +100,7 @@ node('cico-workspace') {
if (params.ghprbPullId != null) { if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/merge" ref = "pull/${ghprbPullId}/merge"
} }
sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh root@${CICO_NODE}:' sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh ./single-node-k8s.sh ./podman2minikube.sh root@${CICO_NODE}:'
ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}" ssh "./prepare.sh --workdir=/opt/build/go/src/github.com/ceph/ceph-csi --gitrepo=${git_repo} --ref=${ref}"
} }
stage('pull base container images') { stage('pull base container images') {