Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run k8s validation for different versions #25

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
}
}
}
}