ci: pass major k8s version to jobs, detect patch release

Jobs can now pass the wanted Kubernetes major version (like '1.19') to
the Jenkins Pipeline scripts. The Pipelines detect the most recent patch
release for the major version with the new get_patch_release.py script.

This causes the CI Job status context to not have the patch number (last
digit of the release) included anymore. Restarting a test will only need
the major version number, as does updating the Mergify configuration.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-09-15 12:59:01 +02:00 committed by Madhu Rajanna
parent 73244ab07b
commit e353d406eb
3 changed files with 22 additions and 6 deletions

View File

@ -2,8 +2,8 @@
- project:
name: mini-e2e
k8s_version:
- '1.18.5'
- '1.19.0'
- '1.18'
- '1.19'
jobs:
- 'mini-e2e_k8s-{k8s_version}'
- 'mini-e2e-helm_k8s-{k8s_version}'

View File

@ -7,6 +7,7 @@ def ref = "master"
def git_since = "master"
def skip_e2e = 0
def doc_change = 0
def k8s_release = 'latest'
def namespace = 'cephcsi-e2e-' + UUID.randomUUID().toString().split('-')[-1]
// ssh executes a given command on the reserved bare-metal machine
@ -37,6 +38,13 @@ node('cico-workspace') {
return
}
stage("detect k8s-${k8s_version} patch release") {
k8s_release = sh(
script: "./scripts/get_patch_release.py --version=${k8s_version}",
returnStdout: true).trim()
echo "detected Kubernetes patch release: ${k8s_release}"
}
stage('checkout PR') {
if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/head"
@ -90,9 +98,9 @@ node('cico-workspace') {
// build e2e.test executable
ssh 'cd /opt/build/go/src/github.com/ceph/ceph-csi && make containerized-build CONTAINER_CMD=podman TARGET=e2e.test'
}
stage("deploy k8s v${k8s_version} and rook") {
stage("deploy k8s-${k8s_version} and rook") {
timeout(time: 30, unit: 'MINUTES') {
ssh "./single-node-k8s.sh --k8s-version=v${k8s_version}"
ssh "./single-node-k8s.sh --k8s-version=${k8s_release}"
}
}
stage('deploy ceph-csi through helm') {

View File

@ -7,6 +7,7 @@ def ref = "master"
def git_since = 'master'
def skip_e2e = 0
def doc_change = 0
def k8s_release = 'latest'
def ssh(cmd) {
sh "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} '${cmd}'"
@ -34,6 +35,13 @@ node('cico-workspace') {
return
}
stage("detect k8s-${k8s_version} patch release") {
k8s_release = sh(
script: "./scripts/get_patch_release.py --version=${k8s_version}",
returnStdout: true).trim()
echo "detected Kubernetes patch release: ${k8s_release}"
}
stage('checkout PR') {
if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/head"
@ -87,9 +95,9 @@ node('cico-workspace') {
// build e2e.test executable
ssh 'cd /opt/build/go/src/github.com/ceph/ceph-csi && make containerized-build CONTAINER_CMD=podman TARGET=e2e.test'
}
stage("deploy k8s v${k8s_version} and rook") {
stage("deploy k8s-${k8s_version} and rook") {
timeout(time: 30, unit: 'MINUTES') {
ssh "./single-node-k8s.sh --k8s-version=v${k8s_version}"
ssh "./single-node-k8s.sh --k8s-version=${k8s_release}"
}
}
stage('run e2e') {