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

OZG-7324 adjust JenkinsFile

parent d232bbb8
No related branches found
No related tags found
No related merge requests found
......@@ -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,8 +486,8 @@ String getBuildProfile() {
}
}
Boolean isMasterBranch() {
return env.BRANCH_NAME == 'master'
Boolean isMainBranch() {
return env.BRANCH_NAME == 'main'
}
Boolean isReleaseBranch() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment