Fix name of recipients variable
Added test for existence of NOTIFICATION_RECIPIENTS env property
Change-Id: Ifaa28939187b29c76682d570292eff8a65829039
diff --git a/git-mirror-2way-pipeline.groovy b/git-mirror-2way-pipeline.groovy
index b9be0ab..21d72bf 100644
--- a/git-mirror-2way-pipeline.groovy
+++ b/git-mirror-2way-pipeline.groovy
@@ -42,7 +42,11 @@
currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
throw e
} finally {
- common.sendNotification(currentBuild.result,"",["slack, email"],["failed"],env["JOB_NAME"],env["BUILD_NUMBER"],env["BUILD_URL"],"MCP jenkins",env["RECIPIENTS"])
+ if(env.getEnvironment().containsKey("NOTIFICATION_RECIPIENTS")){
+ common.sendNotification(currentBuild.result,"",["slack", "email"], ["failed"], env["JOB_NAME"], env["BUILD_NUMBER"], env["BUILD_URL"], "MCP jenkins", env["NOTIFICATION_RECIPIENTS"])
+ }else{
+ common.sendNotification(currentBuild.result, "", ["slack"])
+ }
}
}
}