Skip to content
Snippets Groups Projects
Commit 1ddbe6c2 authored by Martin's avatar Martin
Browse files

OZG-7324 adjust JenkinsFile

parent 25786e3f
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ pipeline {
}
environment {
BLUE_OCEAN_URL = "https://jenkins.infra.ozg-cloud.systems/job/ozgcloud-common/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
JENKINS_URL = "https://jenkins.infra.ozg-cloud.systems/job/codeSH_common-lib/job/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/"
RELEASE_REGEX = /\d+.\d+.\d+/
SNAPSHOT_REGEX = /\d+.\d+.\d+-SNAPSHOT/
}
......@@ -76,7 +76,7 @@ pipeline {
when {
not {
anyOf {
branch 'master'
branch 'main'
branch 'release'
}
}
......@@ -121,7 +121,7 @@ pipeline {
script {
dir('ozgcloud-common-lib') {
try {
if (env.BRANCH_NAME == 'master') {
if (isMainBranch()) {
withSonarQubeEnv('sonarqube-ozg-sh'){
sh 'mvn sonar:sonar'
}
......@@ -151,7 +151,7 @@ pipeline {
post {
failure {
script {
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'release') {
if (isMainBranch() || env.BRANCH_NAME == 'release') {
sendFailureMessage()
}
}
......@@ -179,7 +179,7 @@ Void sendFailureMessage() {
"format": "org.matrix.custom.html", \
"formatted_body":"ozgcloud-common: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${BLUE_OCEAN_URL}'>${env.BUILD_NUMBER}</a>"}"""
if (env.BRANCH_NAME == 'master') {
if (isMainBranch()) {
room = "!GjqhmouBtnDbwUkAjx:matrix.ozg-sh.de"
}
else if (env.BRANCH_NAME == 'release') {
......@@ -200,3 +200,7 @@ String getPomVersion(String pomFile){
return pom.version
}
Boolean isMainBranch() {
return env.BRANCH_NAME == 'main'
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment