From 321f730bc05b7ad3b861dcf6519dde3c5ebf9f44 Mon Sep 17 00:00:00 2001 From: Christopher Grant Date: Fri, 19 Aug 2022 09:44:24 -0700 Subject: [PATCH] Support use of Main branch as well as Master Deploy to production if branch is master OR main --- sample-app/Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sample-app/Jenkinsfile b/sample-app/Jenkinsfile index b2bd8b6..04664de 100644 --- a/sample-app/Jenkinsfile +++ b/sample-app/Jenkinsfile @@ -76,7 +76,12 @@ spec: } stage('Deploy Production') { // Production branch - when { branch 'master' } + when { + anyOf { + branch 'main' + branch 'master' + } + } steps{ container('kubectl') { // Change deployed image in canary to the one we just built @@ -90,6 +95,7 @@ spec: stage('Deploy Dev') { // Developer Branches when { + not { branch 'main' } not { branch 'master' } not { branch 'canary' } }