mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 23:05:50 +00:00
added notifications
This commit is contained in:
parent
1c89b503d1
commit
cf42e77257
1 changed files with 53 additions and 0 deletions
53
Jenkinsfile
vendored
53
Jenkinsfile
vendored
|
@ -7,4 +7,57 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stages {
|
||||||
|
stage ('Start') {
|
||||||
|
steps {
|
||||||
|
// send build started notifications
|
||||||
|
slackSend (color: '#FFFF00', message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
|
||||||
|
|
||||||
|
// send to HipChat
|
||||||
|
hipchatSend (color: 'YELLOW', notify: true,
|
||||||
|
message: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
|
||||||
|
)
|
||||||
|
|
||||||
|
// send to email
|
||||||
|
emailext (
|
||||||
|
subject: "STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
|
||||||
|
body: """<p>STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
|
||||||
|
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
|
||||||
|
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* ... unchanged ... */
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
|
||||||
|
|
||||||
|
hipchatSend (color: 'GREEN', notify: true,
|
||||||
|
message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
|
||||||
|
)
|
||||||
|
|
||||||
|
emailext (
|
||||||
|
subject: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
|
||||||
|
body: """<p>SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
|
||||||
|
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
|
||||||
|
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
failure {
|
||||||
|
slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
|
||||||
|
|
||||||
|
hipchatSend (color: 'RED', notify: true,
|
||||||
|
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
|
||||||
|
)
|
||||||
|
|
||||||
|
emailext (
|
||||||
|
subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
|
||||||
|
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
|
||||||
|
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""",
|
||||||
|
recipientProviders: [[$class: 'DevelopersRecipientProvider']]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue