Skip to content
Snippets Groups Projects
Commit 13ef6d94 authored by Bastian's avatar Bastian
Browse files

OZG-7324 jenkinsfile change branch master to main

parent 4c269c3a
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ pipeline { ...@@ -6,7 +6,7 @@ pipeline {
} }
environment { 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+/ RELEASE_REGEX = /\d+.\d+.\d+/
SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/ SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/
FAILED_STAGE = "" FAILED_STAGE = ""
...@@ -43,7 +43,7 @@ pipeline { ...@@ -43,7 +43,7 @@ pipeline {
when { when {
not { not {
anyOf { anyOf {
branch 'master' branch 'main'
branch 'release' branch 'release'
} }
} }
...@@ -101,7 +101,7 @@ pipeline { ...@@ -101,7 +101,7 @@ pipeline {
stage('Sonar Checks') { stage('Sonar Checks') {
when { when {
branch 'master' branch 'main'
} }
steps { steps {
script { script {
...@@ -126,7 +126,7 @@ pipeline { ...@@ -126,7 +126,7 @@ pipeline {
} }
failure { failure {
script { script {
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'release') { if (env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'release') {
sendFailureMessage() sendFailureMessage()
} }
} }
...@@ -150,12 +150,12 @@ Void sendFailureMessage() { ...@@ -150,12 +150,12 @@ Void sendFailureMessage() {
def room = '' def room = ''
def data = """{"msgtype":"m.text", \ def data = """{"msgtype":"m.text", \
"body":"ArchiveManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} "body":"ArchiveManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER}
Link: ${BLUE_OCEAN_URL}", \ Link: ${JENKINS_URL}", \
"format": "org.matrix.custom.html", \ "format": "org.matrix.custom.html", \
"formatted_body":"ArchiveManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a "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" room = "!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de"
} }
else if (env.BRANCH_NAME == 'release') { else if (env.BRANCH_NAME == 'release') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment