From cd8ecac19e7d200843bcd48ed1407b6d4c77d0ab Mon Sep 17 00:00:00 2001 From: Connel McGovern <100574906+mcgovc@users.noreply.github.com> Date: Mon, 9 May 2022 13:17:58 +0100 Subject: [PATCH 1/4] INFRA-1743 Slack & E-mail notification --- .ci/dev/regression/Jenkinsfile | 56 ++++++++++++---------------------- 1 file changed, 19 insertions(+), 37 deletions(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index d24250c6b7..8cc8686a50 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -3,6 +3,8 @@ * Jenkins pipeline to build Corda OS release branches and tags. * PLEASE NOTE: we DO want to run a build for each commit!!! */ +@Library('corda-shared-build-pipeline-steps') + /** * Sense environment @@ -41,17 +43,6 @@ def nexusIqStageChoices = [nexusDefaultIqStage].plus( 'operate' ].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 */ @@ -74,18 +65,6 @@ pipeline { parallelsAlwaysFailFast() timeout(time: 6, unit: 'HOURS') 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 { @@ -102,6 +81,7 @@ pipeline { CORDA_ARTIFACTORY_PASSWORD = "${env.ARTIFACTORY_CREDENTIALS_PSW}" CORDA_ARTIFACTORY_USERNAME = "${env.ARTIFACTORY_CREDENTIALS_USR}" DOCKER_URL = "https://index.docker.io/v1/" + EMAIL_RECIPIENTS = credentials('corda4-email-recipient') } stages { @@ -383,21 +363,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 { - script { - def statusSymbol = '\u274c' - if (isReleaseTag || isReleaseBranch || isReleaseCandidate) { - emailext subject: "$statusSymbol " + '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!', - body: '${SCRIPT, template="groovy-html.template"}', - recipientProviders: [ - [$class: 'CulpritsRecipientProvider'], - [$class: 'RequesterRecipientProvider'] - ], - mimeType: 'text/html', - replyTo: '$DEFAULT_REPLYTO', - to: "adel.el-beik@r3.com" - } - } + script { + sendSlackNotifications("danger", "BUILD FAILURE", true, "#corda-corda4-open-source-build-notifications") + if (isReleaseTag || isReleaseBranch || isReleaseCandidate) { + sendEmailNotifications("${env.EMAIL_RECIPIENTS}") + } + } } cleanup { deleteDir() /* clean up our workspace */ From 64849455133e3262a1aa905accf46ff6c90cdcf2 Mon Sep 17 00:00:00 2001 From: Connel McGovern <100574906+mcgovc@users.noreply.github.com> Date: Mon, 9 May 2022 16:16:44 +0100 Subject: [PATCH 2/4] Update Jenkinsfile --- .ci/dev/regression/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index 8cc8686a50..a84d758c47 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -365,12 +365,12 @@ pipeline { } success { script { - sendSlackNotifications("good", "BUILD PASSED", false, "#corda-corda4-open-source-build-notifications") + sendSlackNotifications("good", "BUILD PASSED", true, "#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") + sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", true, "#corda-corda4-open-source-build-notifications") } } failure { From bbb6b1a51dbf7c9c8ed070302f0a38b15a8ddb85 Mon Sep 17 00:00:00 2001 From: Connel McGovern <100574906+mcgovc@users.noreply.github.com> Date: Wed, 11 May 2022 14:26:04 +0100 Subject: [PATCH 3/4] NOTICK Remove Slack tagging on successful/unstable builds --- .ci/dev/regression/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index a84d758c47..8cc8686a50 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -365,12 +365,12 @@ pipeline { } success { script { - sendSlackNotifications("good", "BUILD PASSED", true, "#corda-corda4-open-source-build-notifications") + 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", true, "#corda-corda4-open-source-build-notifications") + sendSlackNotifications("warning", "BUILD UNSTABLE - Unstable Builds are likely a result of Nexus Sonar Scanner violations", false, "#corda-corda4-open-source-build-notifications") } } failure { From 589c714cba4b7d5f4336a1df4f17a1addc943559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Tue, 24 May 2022 16:45:09 +0200 Subject: [PATCH 4/4] CORE-4784: Generate license and wiki reports (#7181) --- .ci/dev/regression/Jenkinsfile | 68 +++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index 8cc8686a50..e279bd9d0f 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -5,7 +5,6 @@ */ @Library('corda-shared-build-pipeline-steps') - /** * Sense environment */ @@ -122,6 +121,73 @@ pipeline { ) } } + stage('Generate Wiki Report') { + when { + expression { isReleaseTag && !isInternalRelease && !isReleaseCandidate && !isReleasePatch } + beforeAgent true + } + agent { + docker { + image 'nexusiq-sonatype-cli:latest' + reuseNode true + registryUrl 'https://engineering-docker.software.r3.com/' + registryCredentialsId 'artifactory-credentials' + } + } + options { + retry(3) + } + environment { + NEXUS_APP_ID="${nexusAppId}" + NEXUS_APP_STAGE="${params.nexusIqStage}" + NEXUSIQ_CREDENTIALS = credentials('jenkins-nexusiq-credentials') + } + steps { + sh ''' + rm -f wiki-report.md + env NEXUSIQ_USERNAME="${NEXUSIQ_CREDENTIALS_USR}" \ + NEXUSIQ_PASSWORD="${NEXUSIQ_CREDENTIALS_PSW}" \ + /opt/app/wrapper wiki-report \ + --app "${NEXUS_APP_ID}" \ + --stage "${NEXUS_APP_STAGE}" >wiki-report.md + '''.stripIndent() + archiveArtifacts 'wiki-report.md' + } + } + stage('Generate Licence Report') { + when { + expression { isReleaseTag && !isInternalRelease && !isReleaseCandidate && !isReleasePatch } + beforeAgent true + } + agent { + docker { + image 'nexusiq-licence-report:latest' + reuseNode true + registryUrl 'https://engineering-docker.software.r3.com/' + registryCredentialsId 'artifactory-credentials' + } + } + options { + retry(3) + } + environment { + NEXUS_APP_ID="${nexusAppId}" + NEXUS_APP_STAGE="${params.nexusIqStage}" + NEXUSIQ_CREDENTIALS = credentials('jenkins-nexusiq-credentials') + } + steps { + sh '''\ + rm -rf report + env NEXUSIQ_USERNAME="${NEXUSIQ_CREDENTIALS_USR}" \ + NEXUSIQ_PASSWORD="${NEXUSIQ_CREDENTIALS_PSW}" \ + /opt/app/wrapper --write --outdir report \ + --force \ + --app "${NEXUS_APP_ID}" \ + --stage "${NEXUS_APP_STAGE}" + '''.stripIndent() + archiveArtifacts 'report/*.md' + } + } stage('All Tests') { when {