Skip to content
Snippets Groups Projects
Commit 859f1210 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-533 add slack notification

parent 52a8775a
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,10 @@ pipeline { ...@@ -7,6 +7,10 @@ pipeline {
} }
} }
environment {
BLUE_OCEAN_URL = "https://jenkins.ozg-sh.de/blue/organizations/jenkins/goofy/detail/${env.BRANCH_NAME}/${env.BUILD_NUMBER}/pipeline"
}
options { options {
timeout(time: 1, unit: 'HOURS') timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds() disableConcurrentBuilds()
...@@ -155,6 +159,9 @@ pipeline { ...@@ -155,6 +159,9 @@ pipeline {
} }
steps { steps {
script {
FAILED_STAGE = env.STAGE_NAME
}
container("docker") { container("docker") {
script { script {
withCredentials([usernamePassword(credentialsId: 'jenkins-docker-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { withCredentials([usernamePassword(credentialsId: 'jenkins-docker-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
...@@ -189,4 +196,13 @@ pipeline { ...@@ -189,4 +196,13 @@ pipeline {
} }
} }
} }
post {
failure {
script {
if (env.BRANCH_NAME == 'master') {
slackSend(color: "danger", message: "Goofy: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <${BLUE_OCEAN_URL}|${env.BUILD_NUMBER}>")
}
}
}
}
} }
\ 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