I have installed the pipeline declarative version 1.3.9 and i integrated the slack plugin to send result when pipeline finish. If I see on jenkins I can see that the build is failed but the message i have on slack is success.
This is the pipeline snippet i use to post on slack
def 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}"
what can i do to solve the problem?
edit:
post {
failure {
slackSend channel: '#jenkins',
color: 'danger',
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} - Env ${params.deployEnvironment} \n More info at: ${env.BUILD_URL}"
}
success {
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}"
}
}
even if I do this I have two slack notification in case of failure