slack notif only for main branches
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
parent
567c5a4f55
commit
117bf3834b
|
@ -85,14 +85,24 @@ pipeline {
|
|||
}
|
||||
|
||||
def slackNotif() {
|
||||
script {
|
||||
//BUILD_USER = currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
|
||||
// by ${BUILD_USER}
|
||||
COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
|
||||
stage("Slack Notification"){
|
||||
when {
|
||||
anyOf {
|
||||
branch 'jetty-10.0.x'
|
||||
branch 'jetty-9.4.x'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
//BUILD_USER = currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
|
||||
// by ${BUILD_USER}
|
||||
COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
|
||||
}
|
||||
slackSend channel: '#jenkins',
|
||||
color: COLOR_MAP[currentBuild.currentResult],
|
||||
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}"
|
||||
}
|
||||
}
|
||||
slackSend channel: '#jenkins',
|
||||
color: COLOR_MAP[currentBuild.currentResult],
|
||||
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} \n More info at: ${env.BUILD_URL}"
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue