Support the new Always trigger type.

Support for this trigger was added in email-ext v2.36.

See https://issues.jenkins-ci.org/browse/JENKINS-20013 for more
details.

Change-Id: Ibfb3ec96218fc7133439e17853638593fed41a44
This commit is contained in:
Randy Coulman 2014-03-10 07:34:22 -07:00
parent bed596e8c6
commit abaa7fde6c
3 changed files with 15 additions and 0 deletions

View File

@ -1392,6 +1392,7 @@ def email_ext(parser, xml_parent, data):
javascript to hook into the Jenkins API itself
:arg bool attach-build-log: Include build log in the email (default false)
:arg str attachments: pattern of files to include as attachment (optional)
:arg bool always: Send an email for every result (default false)
:arg bool unstable: Send an email for an unstable result (default false)
:arg bool first-failure: Send an email for just the first failure
(default false)
@ -1426,6 +1427,8 @@ def email_ext(parser, xml_parent, data):
else:
XML.SubElement(emailext, 'recipientList').text = '$DEFAULT_RECIPIENTS'
ctrigger = XML.SubElement(emailext, 'configuredTriggers')
if data.get('always', False):
base_email_ext(parser, ctrigger, data, 'AlwaysTrigger')
if data.get('unstable', False):
base_email_ext(parser, ctrigger, data, 'UnstableTrigger')
if data.get('first-failure', False):

View File

@ -4,6 +4,17 @@
<hudson.plugins.emailext.ExtendedEmailPublisher>
<recipientList>foo@example.com, bar@example.com</recipientList>
<configuredTriggers>
<hudson.plugins.emailext.plugins.trigger.AlwaysTrigger>
<email>
<recipientList/>
<subject>$PROJECT_DEFAULT_SUBJECT</subject>
<body>$PROJECT_DEFAULT_CONTENT</body>
<sendToDevelopers>false</sendToDevelopers>
<sendToRequester>false</sendToRequester>
<includeCulprits>false</includeCulprits>
<sendToRecipientList>true</sendToRecipientList>
</email>
</hudson.plugins.emailext.plugins.trigger.AlwaysTrigger>
<hudson.plugins.emailext.plugins.trigger.UnstableTrigger>
<email>
<recipientList/>

View File

@ -7,6 +7,7 @@ publishers:
body: The build has finished
attach-build-log: false
attachments: "*/foo*.log"
always: true
unstable: true
first-failure: true
not-built: true