Skip to content

Commit

Permalink
ci: run k8s validation for different versions (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Feb 15, 2022
1 parent fba2c48 commit f3d3121
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,7 @@ pipeline {
expression { return env.PLATFORM == 'ubuntu-20.04 && immutable' }
}
steps {
withGithubNotify(context: "K8s-${PLATFORM}") {
withMageEnv(){
withKindEnv(k8sVersion: 'v1.23.0', kindVersion: 'v0.11.1') {
dir("${BASE_DIR}"){
sh(label: "Deploy to kubernetes",script: "make -C deploy/kubernetes test")
}
}
}
}
runK8s(k8sVersion: 'v1.23.0', kindVersion: 'v0.11.1', context: "K8s-${PLATFORM}")
}
}
}
Expand Down Expand Up @@ -143,6 +135,17 @@ pipeline {
}
}
}
stage('K8s') {
when {
// TODO: Run only if changes in
// - "^deploy/kubernetes/.*"
// - "^version/docs/version.asciidoc"
not { changeRequest() }
}
steps {
runAllK8s(["v1.23.0", "v1.22.0", "v1.21.1", "v1.20.7", "v1.19.11", "v1.18.19"])
}
}
}
post {
cleanup {
Expand Down Expand Up @@ -221,3 +224,27 @@ def withPackageDarwinEnv(Closure body) {
body()
}
}

def runAllK8s(versions) {
def parallelTasks = [:]
versions.each { version ->
node('ubuntu-20.04 && immutable') {
deleteDir()
unstash 'source'
runK8s(k8sVersion: version, kindVersion: 'v0.11.1', context: "K8s-${version}")
}
}
parallel(parallelTasks)
}

def runK8s(Map args=[:]) {
withGithubNotify(context: args.context) {
withMageEnv(){
withKindEnv(args) {
dir("${BASE_DIR}"){
sh(label: "Deploy to kubernetes",script: "make -C deploy/kubernetes test")
}
}
}
}
}

0 comments on commit f3d3121

Please sign in to comment.