From acde02da35102b078454374357bd5c70a6f81a86 Mon Sep 17 00:00:00 2001 From: Martin <git@mail.de> Date: Thu, 19 Dec 2024 15:49:44 +0100 Subject: [PATCH] OZG-7324 adjust JenkinsFile --- Jenkinsfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9ca5bab6..7f3bf78c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { } environment { - BLUE_OCEAN_URL = "https://jenkins.infra.ozg-cloud.systems/job/zufi-manager/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/" + JENKINS_URL = "https://jenkins.infra.ozg-cloud.systems/job/codeSH_zufi-manager/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/" RELEASE_REGEX = /\d+.\d+.\d+/ SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/ FAILED_STAGE = "" @@ -75,7 +75,7 @@ pipeline { when { not { anyOf { - branch 'master' + branch 'main' branch 'release' } } @@ -180,7 +180,7 @@ pipeline { stage('Sonar Checks') { when { - branch 'master' + branch 'main' } steps { script { @@ -226,7 +226,7 @@ pipeline { stage('Trigger Dev rollout') { when { - branch 'master' + branch 'main' } steps { script { @@ -263,7 +263,7 @@ pipeline { post { failure { script { - if (isMasterBranch() || isReleaseBranch()) { + if (isMainBranch() || isReleaseBranch()) { sendFailureMessage() } } @@ -334,11 +334,11 @@ String buildVersionName() { Void sendFailureMessage() { def room = '' def data = """{"msgtype":"m.text", \ - "body":"zufiManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${BLUE_OCEAN_URL}", \ + "body":"zufiManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${JENKINS_URL}", \ "format": "org.matrix.custom.html", \ - "formatted_body":"zufiManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${BLUE_OCEAN_URL}'>${env.BUILD_NUMBER}</a>"}""" + "formatted_body":"zufiManager: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${JENKINS_URL}'>${env.BUILD_NUMBER}</a>"}""" - if (isMasterBranch()) { + if (isMainBranch()) { room = "!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de" } else if (isReleaseBranch()) { room = "!oWZpUGTFsxkJIYNfYg:matrix.ozg-sh.de" @@ -477,7 +477,7 @@ String getPomVersion(String pomFile){ } String getBuildProfile() { - if (isMasterBranch()) { + if (isMainBranch()) { return "-P dev" } else if (isReleaseBranch()) { return "-P release" @@ -486,10 +486,10 @@ String getBuildProfile() { } } -Boolean isMasterBranch() { - return env.BRANCH_NAME == 'master' +Boolean isMainBranch() { + return env.BRANCH_NAME == 'main' } Boolean isReleaseBranch() { return env.BRANCH_NAME == 'release' -} \ No newline at end of file +} -- GitLab