mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +00:00
INFRA-1743 Slack & E-mail notification
This commit is contained in:
parent
a99a25fcf7
commit
5149889b34
55
.ci/dev/regression/Jenkinsfile
vendored
55
.ci/dev/regression/Jenkinsfile
vendored
@ -3,6 +3,7 @@
|
|||||||
* Jenkins pipeline to build Corda OS release branches and tags.
|
* Jenkins pipeline to build Corda OS release branches and tags.
|
||||||
* PLEASE NOTE: we DO want to run a build for each commit!!!
|
* PLEASE NOTE: we DO want to run a build for each commit!!!
|
||||||
*/
|
*/
|
||||||
|
@Library('corda-shared-build-pipeline-steps')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sense environment
|
* Sense environment
|
||||||
@ -41,17 +42,6 @@ def nexusIqStageChoices = [nexusDefaultIqStage].plus(
|
|||||||
'operate'
|
'operate'
|
||||||
].minus([nexusDefaultIqStage]))
|
].minus([nexusDefaultIqStage]))
|
||||||
|
|
||||||
/**
|
|
||||||
* define an empty teamsWebHookURL and if it is a Release Branch
|
|
||||||
* then set it for the Corda 4 Jenkins Connector
|
|
||||||
*/
|
|
||||||
def teamsWebHookURL = ""
|
|
||||||
if (isReleaseBranch || isReleaseTag){
|
|
||||||
withCredentials([string(credentialsId: 'ms-teams-webhook', variable: 'webhook_url')]) {
|
|
||||||
teamsWebHookURL = "$webhook_url"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common Gradle arguments for all Gradle executions
|
* Common Gradle arguments for all Gradle executions
|
||||||
*/
|
*/
|
||||||
@ -74,18 +64,6 @@ pipeline {
|
|||||||
parallelsAlwaysFailFast()
|
parallelsAlwaysFailFast()
|
||||||
timeout(time: 6, unit: 'HOURS')
|
timeout(time: 6, unit: 'HOURS')
|
||||||
timestamps()
|
timestamps()
|
||||||
office365ConnectorWebhooks([[
|
|
||||||
name : "Corda 4 Jenkins Connector",
|
|
||||||
notifyBackToNormal : true,
|
|
||||||
startNotification : false,
|
|
||||||
notifyFailure : true,
|
|
||||||
notifySuccess : true,
|
|
||||||
notifyNotBuilt : false,
|
|
||||||
notifyAborted : false,
|
|
||||||
notifyRepeatedFailure: true,
|
|
||||||
notifyUnstable : true,
|
|
||||||
url : "${teamsWebHookURL}"
|
|
||||||
]])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parameters {
|
parameters {
|
||||||
@ -102,6 +80,7 @@ pipeline {
|
|||||||
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}"
|
||||||
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}"
|
||||||
DOCKER_URL = "https://index.docker.io/v1/"
|
DOCKER_URL = "https://index.docker.io/v1/"
|
||||||
|
EMAIL_RECIPIENTS = credentials('corda4-email-recipient')
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@ -383,21 +362,23 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
success {
|
||||||
|
script {
|
||||||
|
sendSlackNotifications("good", "BUILD PASSED", false, "#corda-corda4-open-source-build-notifications")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unstable {
|
||||||
|
script {
|
||||||
|
sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", false, "#corda-corda4-open-source-build-notifications")
|
||||||
|
}
|
||||||
|
}
|
||||||
failure {
|
failure {
|
||||||
script {
|
script {
|
||||||
def statusSymbol = '\u274c'
|
sendSlackNotifications("danger", "BUILD FAILURE", true, "#corda-corda4-open-source-build-notifications")
|
||||||
if (isReleaseTag || isReleaseBranch || isReleaseCandidate) {
|
if (isReleaseTag || isReleaseBranch || isReleaseCandidate) {
|
||||||
emailext subject: "$statusSymbol " + '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!',
|
sendEmailNotifications("${env.EMAIL_RECIPIENTS}")
|
||||||
body: '${SCRIPT, template="groovy-html.template"}',
|
}
|
||||||
recipientProviders: [
|
}
|
||||||
[$class: 'CulpritsRecipientProvider'],
|
|
||||||
[$class: 'RequesterRecipientProvider']
|
|
||||||
],
|
|
||||||
mimeType: 'text/html',
|
|
||||||
replyTo: '$DEFAULT_REPLYTO',
|
|
||||||
to: "adel.el-beik@r3.com"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cleanup {
|
cleanup {
|
||||||
deleteDir() /* clean up our workspace */
|
deleteDir() /* clean up our workspace */
|
||||||
|
Loading…
Reference in New Issue
Block a user