Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): send slack notification for chaos tests #4527

Merged
merged 1 commit into from
May 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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