From f29443f665ca9ce9f0f0862cb0bb5961a8e1307c Mon Sep 17 00:00:00 2001
From: Bastian <bastian.heppener@mgm-tp.com>
Date: Tue, 7 Jan 2025 13:57:38 +0100
Subject: [PATCH] OZG-7324 jenkinsfile change branch master to main

---
 alfa-client/Jenkinsfile.e2e       | 10 +++++-----
 alfa-client/Jenkinsfile.storybook | 16 ++++++++--------
 alfa-client/apps/info/Jenkinsfile | 16 ++++++++--------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/alfa-client/Jenkinsfile.e2e b/alfa-client/Jenkinsfile.e2e
index 3536046803..d065955cf2 100644
--- a/alfa-client/Jenkinsfile.e2e
+++ b/alfa-client/Jenkinsfile.e2e
@@ -87,7 +87,7 @@ pipeline {
             }
             steps {
                 script {
-                     if (!isMasterBranch()) {
+                     if (!isMainBranch()) {
                         echo "Branchname "+env.BRANCH_NAME+" does not match, skipping e2e tests"
                         SKIP_RUN = true
                     }
@@ -388,7 +388,7 @@ pipeline {
     post {
         failure {
             script {
-                if (isMasterBranch() || isReleaseBranch()) {
+                if (isMainBranch() || isReleaseBranch()) {
                     sendFailureMessage()
                 }
             }
@@ -397,7 +397,7 @@ pipeline {
 }
 
 String getUpstreamProjects() {
-    if (isMasterBranch() || isReleaseBranch()){
+    if (isMainBranch() || isReleaseBranch()){
         return "alfa/${env.BRANCH_NAME},vorgang-manager/${env.BRANCH_NAME},user-manager/${env.BRANCH_NAME}"
     }
 
@@ -440,8 +440,8 @@ String getHelmChartVersion(Map applicationValues) {
     return applicationValues.helm.version
 }
 
-Boolean isMasterBranch() {
-    return env.BRANCH_NAME == 'master'
+Boolean isMainBranch() {
+    return env.BRANCH_NAME == 'main'
 }
 
 String getHelmRepoUrl() {
diff --git a/alfa-client/Jenkinsfile.storybook b/alfa-client/Jenkinsfile.storybook
index 6dacb84fdd..af349c0765 100644
--- a/alfa-client/Jenkinsfile.storybook
+++ b/alfa-client/Jenkinsfile.storybook
@@ -80,7 +80,7 @@ pipeline {
 
                     tagAndPushDockerImage(IMAGE_TAG)
 
-                    if (isMasterBranch()) {
+                    if (isMainBranch()) {
                         tagAndPushDockerImage('snapshot-latest')
                     }
                 }
@@ -108,7 +108,7 @@ pipeline {
 
         stage('Trigger Dev rollout') {
             when {
-                branch 'master'
+                branch 'main'
             }
             steps {
                 script {
@@ -126,7 +126,7 @@ pipeline {
     post {
         failure {
             script {
-                if (isMasterBranch()) {
+                if (isMainBranch()) {
                     sendFailureMessage()
                 }
             }
@@ -139,7 +139,7 @@ pipeline {
 String generateImageTag() {
     def imageTag = "${env.BRANCH_NAME}-${VERSION}"
 
-    if (isMasterBranch()) {
+    if (isMainBranch()) {
         imageTag += "-${env.GIT_COMMIT.take(7)}"
     }
 
@@ -230,7 +230,7 @@ Void deployHelmChart(String helmChartVersion) {
 String generateHelmChartVersion() {
     def chartVersion = "${VERSION}"
 
-    if (isMasterBranch()) {
+    if (isMainBranch()) {
         chartVersion += "-${env.GIT_COMMIT.take(7)}"
     }
     else {
@@ -240,8 +240,8 @@ String generateHelmChartVersion() {
     return chartVersion.replaceAll("_", "-")
 }
 
-Boolean isMasterBranch() {
-    return env.BRANCH_NAME == 'master'
+Boolean isMainBranch() {
+    return env.BRANCH_NAME == 'main'
 }
 
 Void sendFailureMessage() {
@@ -251,7 +251,7 @@ Void sendFailureMessage() {
                     "format": "org.matrix.custom.html", \
                     "formatted_body":"storybook: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${BLUE_OCEAN_URL}'>${env.BUILD_NUMBER}</a>"}"""
 
-    if (isMasterBranch()) {
+    if (isMainBranch()) {
         room = "!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de"
     }
 
diff --git a/alfa-client/apps/info/Jenkinsfile b/alfa-client/apps/info/Jenkinsfile
index 1484606baa..5634305a38 100644
--- a/alfa-client/apps/info/Jenkinsfile
+++ b/alfa-client/apps/info/Jenkinsfile
@@ -64,7 +64,7 @@ pipeline {
 
     stage('Tag and Push snapshot-latest Docker image') {
       when {
-        branch 'master'
+        branch 'main'
       }
       steps {
         script {
@@ -111,7 +111,7 @@ pipeline {
 
     stage('Trigger Dev Rollout') {
       when {
-        branch 'master'
+        branch 'main'
       }
       steps {
         script {
@@ -143,7 +143,7 @@ pipeline {
   post {
     failure {
       script {
-        if (isMasterBranch() || isReleaseBranch()) {
+        if (isMainBranch() || isReleaseBranch()) {
           sendFailureMessage()
         }
       }
@@ -157,7 +157,7 @@ Boolean isReleaseBranch() {
 String generateImageTag() {
     def imageTag = "${env.BRANCH_NAME}-${VERSION}"
 
-    if (isMasterBranch()) {
+    if (isMainBranch()) {
         imageTag += "-${env.GIT_COMMIT.take(7)}"
     }
 
@@ -268,7 +268,7 @@ Void deployHelmChart(String helmChartVersion) {
 String generateHelmChartVersion() {
     def chartVersion = "${VERSION}"
 
-    if (isMasterBranch()) {
+    if (isMainBranch()) {
         chartVersion += "-${env.GIT_COMMIT.take(7)}"
     }
     else if (!isReleaseBranch()) {
@@ -278,8 +278,8 @@ String generateHelmChartVersion() {
     return chartVersion.replaceAll("_", "-")
 }
 
-Boolean isMasterBranch() {
-    return env.BRANCH_NAME == 'master'
+Boolean isMainBranch() {
+    return env.BRANCH_NAME == 'main'
 }
 
 Void sendFailureMessage() {
@@ -289,7 +289,7 @@ Void sendFailureMessage() {
                     "format": "org.matrix.custom.html", \
                     "formatted_body":"Info-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${BLUE_OCEAN_URL}'>${env.BUILD_NUMBER}</a>"}"""
 
-    if (isMasterBranch()) {
+    if (isMainBranch()) {
         room = "!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de"
     }
     else if (isReleaseBranch()) {
-- 
GitLab