Skip to content

Commit

Permalink
V1.x (#58)
Browse files Browse the repository at this point in the history
Signed-off-by: zFernand0 <fernando.rijocedeno@broadcom.com>
  • Loading branch information
zFernand0 authored Aug 27, 2019
1 parent f33d5b2 commit 443baa6
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/org/zowe/pipelines/base/Pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ class Pipeline {
*/
final PipelineAdmins admins = new PipelineAdmins()

/**
* This is a generic list of comma-separated emails that should also get notified besides admins
*/
String emailList = ""

/**
* The number of historical builds kept for a non-protected branch.
*/
Expand Down Expand Up @@ -842,11 +847,12 @@ class Pipeline {

try {
// send the email
sendHtmlEmail(
subjectTag: subject,
body: bodyText,
to: _isProtectedBranch ? admins.getCCList() : ""
)
if (emailList) {
emailList = "$emailList${emailList[-1] != ',' && _isProtectedBranch ? ',' : ''}" // Add comma if required
sendHtmlEmail(subjectTag: subject, body: bodyText, to: _isProtectedBranch ? "$emailList${admins.getCCList()}" : emailList)
} else {
sendHtmlEmail(subjectTag: subject, body: bodyText, to: _isProtectedBranch ? admins.getCCList() : "")
}
}
catch (emailException) {
steps.echo "Exception encountered while attempting to send email!"
Expand Down

0 comments on commit 443baa6

Please sign in to comment.