From 13ef6d9460e4a636a1ffd30ede43dfa804a7cb9f Mon Sep 17 00:00:00 2001
From: Bastian <bastian.heppener@mgm-tp.com>
Date: Thu, 19 Dec 2024 20:48:34 +0100
Subject: [PATCH] OZG-7324 jenkinsfile change branch master to main

---
 Jenkinsfile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 42cb6f0..fc9887b 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -6,7 +6,7 @@ pipeline {
     }
 
     environment {
-        BLUE_OCEAN_URL = "https://jenkins.infra.ozg-cloud.systems/job/archive-manager/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
+        JENKINS_URL = "https://jenkins.infra.ozg-cloud.systems/job/codeSH_archive-manager/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
         RELEASE_REGEX = /\d+.\d+.\d+/
         SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/
         FAILED_STAGE = ""
@@ -43,7 +43,7 @@ pipeline {
           when {
             not {
                 anyOf {
-                    branch 'master'
+                    branch 'main'
                     branch 'release'
                 }
             }
@@ -101,7 +101,7 @@ pipeline {
 
         stage('Sonar Checks') {
             when {
-                branch 'master'
+                branch 'main'
             }
         	steps {
         	    script {
@@ -126,7 +126,7 @@ pipeline {
         }
         failure {
             script {
-                if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'release') {
+                if (env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'release') {
                     sendFailureMessage()
                 }
             }
@@ -150,12 +150,12 @@ Void sendFailureMessage() {
     def room = ''
     def data = """{"msgtype":"m.text", \
                     "body":"ArchiveManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER}
-                    Link: ${BLUE_OCEAN_URL}", \
+                    Link: ${JENKINS_URL}", \
                     "format": "org.matrix.custom.html", \
                     "formatted_body":"ArchiveManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a
-                    href='${BLUE_OCEAN_URL}'>${env.BUILD_NUMBER}</a>"}"""
+                    href='${JENKINS_URL}'>${env.BUILD_NUMBER}</a>"}"""
 
-    if (env.BRANCH_NAME == 'master') {
+    if (env.BRANCH_NAME == 'main') {
         room = "!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de"
     }
     else if (env.BRANCH_NAME == 'release') {
-- 
GitLab