Skip to content

Commit

Permalink
Merge #4527
Browse files Browse the repository at this point in the history
4527: chore(ci): send slack notification for chaos tests r=Zelldon a=Zelldon

## Description

Sends notification to slack instead of mails for changed Zeebe Chaos build status.
<!-- Please explain the changes you made here. -->


Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
  • Loading branch information
zeebe-bors[bot] and Zelldon committed May 15, 2020
2 parents 982a2ae + 740718c commit e693c65
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .ci/pipelines/chaos_test_zeebe.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
final PROJECT = "zeebe"
final CHAOS_TEST_NAMESPACE = "zeebe-chaos-test"
final NOTIFY_EMAIL = "christopher.zell@camunda.com"

pipeline {
options {
Expand Down Expand Up @@ -91,20 +90,15 @@ pipeline {
}
}

failure {
buildNotification(currentBuild.result, NOTIFY_EMAIL)
changed {
script {
slackSend(
channel: "#zeebe-ci${jenkins.model.JenkinsLocationConfiguration.get()?.getUrl()?.contains('stage') ? '-stage' : ''}",
message: "Zeebe ${env.JOB_NAME} build ${currentBuild.absoluteUrl} changed status to ${currentBuild.currentResult}")
}
}
}
}

void buildNotification(String buildStatus, String to) {

buildStatus = buildStatus ?: 'SUCCESS'

String subject = "[${buildStatus}] - ${env.JOB_NAME} - Build #${env.BUILD_NUMBER}"
String body = "See: ${env.BUILD_URL}consoleFull"

emailext subject: subject, body: body, to: to
}
}

static String pythonAgent() {
Expand Down

0 comments on commit e693c65

Please sign in to comment.