From ecaa495f301f2fd3437c9142c7592e726c52e9ea Mon Sep 17 00:00:00 2001 From: Anisha Mohanty Date: Mon, 4 Oct 2021 11:20:14 +0530 Subject: [PATCH] DBZ-4071 Recipient email address should be a variable in all Jenkins jobs --- jenkins-jobs/pipelines/build-debezium-images.groovy | 3 ++- jenkins-jobs/pipelines/deploy-snapshots.groovy | 4 +++- .../pipelines/downstream_apicurio_prepare_pipeline.groovy | 4 +++- .../downstream_artifact_server_prepare_pipeline.groovy | 4 +++- jenkins-jobs/pipelines/downstream_prepare_pipeline.groovy | 4 +++- jenkins-jobs/pipelines/openshift_pipeline.groovy | 4 +++- jenkins-jobs/pipelines/prod-release-pipeline.groovy | 3 ++- jenkins-jobs/pipelines/release-pipeline.groovy | 4 +++- .../pipelines/rhel_downstream_prepare_pipeline.groovy | 4 +++- 9 files changed, 25 insertions(+), 9 deletions(-) diff --git a/jenkins-jobs/pipelines/build-debezium-images.groovy b/jenkins-jobs/pipelines/build-debezium-images.groovy index 6fe3a95e8..ba8ff1e47 100644 --- a/jenkins-jobs/pipelines/build-debezium-images.groovy +++ b/jenkins-jobs/pipelines/build-debezium-images.groovy @@ -7,6 +7,7 @@ STREAMS_TO_BUILD_COUNT = STREAMS_TO_BUILD_COUNT.toInteger() TAGS_PER_STREAM_COUNT = TAGS_PER_STREAM_COUNT.toInteger() GIT_CREDENTIALS_ID = 'debezium-github' DOCKER_CREDENTIALS_ID = 'debezium-dockerhub' +MAIL_ID = 'jpechane@redhat.com' class Version implements Comparable { int major @@ -181,6 +182,6 @@ node('Slave') { } } } finally { - mail to: 'jpechane@redhat.com', subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" + mail to: ${MAIL_ID}, subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" } } diff --git a/jenkins-jobs/pipelines/deploy-snapshots.groovy b/jenkins-jobs/pipelines/deploy-snapshots.groovy index 40ada77b5..ea11761e7 100644 --- a/jenkins-jobs/pipelines/deploy-snapshots.groovy +++ b/jenkins-jobs/pipelines/deploy-snapshots.groovy @@ -14,6 +14,8 @@ GIT_CREDENTIALS_ID = 'debezium-github' DEBEZIUM_DIR = 'debezium' HOME_DIR = '/home/centos' +MAIL_ID = 'jpechane@redhat.com' + ORACLE_ARTIFACT_DIR = "$HOME_DIR/oracle-libs/21.1.0.0.0" ORACLE_ARTIFACT_VERSION = '21.1.0.0' @@ -64,6 +66,6 @@ node('Slave') { } } } finally { - mail to: 'jpechane@redhat.com', subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" + mail to: ${MAIL_ID}, subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" } } diff --git a/jenkins-jobs/pipelines/downstream_apicurio_prepare_pipeline.groovy b/jenkins-jobs/pipelines/downstream_apicurio_prepare_pipeline.groovy index 350efa6e1..d50523087 100644 --- a/jenkins-jobs/pipelines/downstream_apicurio_prepare_pipeline.groovy +++ b/jenkins-jobs/pipelines/downstream_apicurio_prepare_pipeline.groovy @@ -1,3 +1,5 @@ +MAIL_ID = 'jcechace@redhat.com' + pipeline { agent { label 'Slave' @@ -60,7 +62,7 @@ pipeline { post { always { - mail to: 'jcechace@redhat.com', subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ + mail to: ${MAIL_ID}, subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ ${currentBuild.projectName} run ${BUILD_URL} finished with result: ${currentBuild.currentResult} """ } diff --git a/jenkins-jobs/pipelines/downstream_artifact_server_prepare_pipeline.groovy b/jenkins-jobs/pipelines/downstream_artifact_server_prepare_pipeline.groovy index 3608bbb52..99eafb831 100644 --- a/jenkins-jobs/pipelines/downstream_artifact_server_prepare_pipeline.groovy +++ b/jenkins-jobs/pipelines/downstream_artifact_server_prepare_pipeline.groovy @@ -1,3 +1,5 @@ +MAIL_ID = 'jcechace@redhat.com' + pipeline { agent { label 'Slave' @@ -48,7 +50,7 @@ pipeline { post { always { - mail to: 'jcechace@redhat.com', subject: "Debezium artifact server preparation #${BUILD_NUMBER} finished", body: """ + mail to: ${MAIL_ID}, subject: "Debezium artifact server preparation #${BUILD_NUMBER} finished", body: """ ${currentBuild.projectName} run ${BUILD_URL} finished with result: ${currentBuild.currentResult} """ } diff --git a/jenkins-jobs/pipelines/downstream_prepare_pipeline.groovy b/jenkins-jobs/pipelines/downstream_prepare_pipeline.groovy index 5580fca71..421807bb1 100644 --- a/jenkins-jobs/pipelines/downstream_prepare_pipeline.groovy +++ b/jenkins-jobs/pipelines/downstream_prepare_pipeline.groovy @@ -1,3 +1,5 @@ +MAIL_ID = 'jcechace@redhat.com' + pipeline { agent { label 'Slave' @@ -81,7 +83,7 @@ pipeline { post { always { - mail to: 'jcechace@redhat.com', subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ + mail to: ${MAIL_ID}, subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ ${currentBuild.projectName} run ${BUILD_URL} finished with result: ${currentBuild.currentResult} """ } diff --git a/jenkins-jobs/pipelines/openshift_pipeline.groovy b/jenkins-jobs/pipelines/openshift_pipeline.groovy index d588105d8..211750ccf 100644 --- a/jenkins-jobs/pipelines/openshift_pipeline.groovy +++ b/jenkins-jobs/pipelines/openshift_pipeline.groovy @@ -1,3 +1,5 @@ +MAIL_ID = 'jcechace@redhat.com' + pipeline { agent { label 'Slave' @@ -216,7 +218,7 @@ pipeline { archiveArtifacts '**/target/failsafe-reports/*.xml' junit '**/target/failsafe-reports/*.xml' - mail to: 'jcechace@redhat.com', subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ + mail to: ${MAIL_ID}, subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ OpenShift interoperability test run ${BUILD_URL} finished with result: ${currentBuild.currentResult} """ } diff --git a/jenkins-jobs/pipelines/prod-release-pipeline.groovy b/jenkins-jobs/pipelines/prod-release-pipeline.groovy index 67d9fbb9e..02ed9d769 100644 --- a/jenkins-jobs/pipelines/prod-release-pipeline.groovy +++ b/jenkins-jobs/pipelines/prod-release-pipeline.groovy @@ -14,6 +14,7 @@ if ( error 'Input parameters not provided' } +MAIL_ID = 'jpechane@redhat.com' CONFIG_DIR = '.config/pnc-bacon' BUILD_CONFIG_DIR = 'debezium-bacon' BACON_MAVEN_URL = "https://repo1.maven.org/maven2/org/jboss/pnc/bacon/cli/$BACON_VERSION/cli-$BACON_VERSION-shaded.jar" @@ -78,6 +79,6 @@ node('Slave') { } } } finally { - mail to: 'jpechane@redhat.com', subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" + mail to: ${MAIL_ID}, subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" } } diff --git a/jenkins-jobs/pipelines/release-pipeline.groovy b/jenkins-jobs/pipelines/release-pipeline.groovy index a97e14a07..87a109324 100644 --- a/jenkins-jobs/pipelines/release-pipeline.groovy +++ b/jenkins-jobs/pipelines/release-pipeline.groovy @@ -28,6 +28,8 @@ echo "Dry run: ${DRY_RUN}" GIT_CREDENTIALS_ID = 'debezium-github' JIRA_CREDENTIALS_ID = 'debezium-jira' +MAIL_ID = 'jpechane@redhat.com' + HOME_DIR = '/home/centos' GPG_DIR = 'gpg' @@ -681,6 +683,6 @@ node('Slave') { } } finally { - mail to: 'jpechane@redhat.com', subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" + mail to: ${MAIL_ID}, subject: "${JOB_NAME} run #${BUILD_NUMBER} finished", body: "Run ${BUILD_URL} finished with result: ${currentBuild.currentResult}" } } diff --git a/jenkins-jobs/pipelines/rhel_downstream_prepare_pipeline.groovy b/jenkins-jobs/pipelines/rhel_downstream_prepare_pipeline.groovy index ff35c0cc7..204eecc03 100644 --- a/jenkins-jobs/pipelines/rhel_downstream_prepare_pipeline.groovy +++ b/jenkins-jobs/pipelines/rhel_downstream_prepare_pipeline.groovy @@ -1,3 +1,5 @@ +MAIL_ID = 'jcechace@redhat.com' + pipeline { agent { label 'Slave' @@ -48,7 +50,7 @@ pipeline { post { always { - mail to: 'jcechace@redhat.com', subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ + mail to: ${MAIL_ID}, subject: "Debezium OpenShift test run #${BUILD_NUMBER} finished", body: """ ${currentBuild.projectName} run ${BUILD_URL} finished with result: ${currentBuild.currentResult} """ }