Skip to content

Commit

Permalink
Message slack (#3069)
Browse files Browse the repository at this point in the history
* Message slack for prod AMI success/fail, stag AMI fail

* Message staging build failures also
  • Loading branch information
marten committed Feb 7, 2019
1 parent e308839 commit ea0af16
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions Jenkinsfile
Expand Up @@ -69,6 +69,15 @@ pipeline {
kill \${KEEP_ALIVE_ECHO_JOB}
"""
}
post {
failure {
slackSend (
color: '#FF0000',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
}
}
stage('Staging Dump workers') {
when { branch 'master' }
Expand All @@ -90,6 +99,15 @@ pipeline {
kill \${KEEP_ALIVE_ECHO_JOB}
"""
}
post {
failure {
slackSend (
color: '#FF0000',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
}
}
stage('Production API') {
when { tag 'production-release' }
Expand All @@ -111,6 +129,22 @@ pipeline {
kill \${KEEP_ALIVE_ECHO_JOB}
"""
}
post {
success {
slackSend (
color: '#00FF00',
message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
failure {
slackSend (
color: '#FF0000',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
}
}
stage('Production Dump workers') {
when { tag 'production-release' }
Expand All @@ -132,6 +166,22 @@ pipeline {
kill \${KEEP_ALIVE_ECHO_JOB}
"""
}
post {
success {
slackSend (
color: '#00FF00',
message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
failure {
slackSend (
color: '#FF0000',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
}
}
}
}
Expand Down Expand Up @@ -162,6 +212,15 @@ pipeline {
kill \${KEEP_ALIVE_ECHO_JOB}
"""
}
post {
failure {
slackSend (
color: '#FF0000',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
}
}

stage('Deploy staging AMIs') {
Expand Down Expand Up @@ -209,6 +268,15 @@ pipeline {
}
}
}
post {
failure {
slackSend (
color: '#FF0000',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})",
channel: "#ops"
)
}
}
}
}
}

0 comments on commit ea0af16

Please sign in to comment.