Merge "The email publisher needs a list of recipients"
This commit is contained in:
commit
055b6360fa
@ -1312,18 +1312,16 @@ def email(parser, xml_parent, data):
|
||||
:arg bool send-to-individuals: Send an email to the individual
|
||||
who broke the build (default false)
|
||||
|
||||
Example::
|
||||
Example:
|
||||
|
||||
publishers:
|
||||
- email:
|
||||
recipients: breakage@example.com
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/email001.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
|
||||
# TODO: raise exception if this is applied to a maven job
|
||||
mailer = XML.SubElement(xml_parent,
|
||||
'hudson.tasks.Mailer')
|
||||
if 'recipients' in data:
|
||||
XML.SubElement(mailer, 'recipients').text = data['recipients']
|
||||
XML.SubElement(mailer, 'recipients').text = data.get('recipients', '')
|
||||
|
||||
# Note the logic reversal (included here to match the GUI
|
||||
if data.get('notify-every-unstable-build', True):
|
||||
|
10
tests/publishers/fixtures/email001.xml
Normal file
10
tests/publishers/fixtures/email001.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<hudson.tasks.Mailer>
|
||||
<recipients>foo@example.com bar@example.com</recipients>
|
||||
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
|
||||
<sendToIndividuals>false</sendToIndividuals>
|
||||
</hudson.tasks.Mailer>
|
||||
</publishers>
|
||||
</project>
|
3
tests/publishers/fixtures/email001.yaml
Normal file
3
tests/publishers/fixtures/email001.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
publishers:
|
||||
- email:
|
||||
recipients: foo@example.com bar@example.com
|
10
tests/publishers/fixtures/email002.xml
Normal file
10
tests/publishers/fixtures/email002.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<hudson.tasks.Mailer>
|
||||
<recipients/>
|
||||
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
|
||||
<sendToIndividuals>true</sendToIndividuals>
|
||||
</hudson.tasks.Mailer>
|
||||
</publishers>
|
||||
</project>
|
4
tests/publishers/fixtures/email002.yaml
Normal file
4
tests/publishers/fixtures/email002.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
publishers:
|
||||
- email:
|
||||
send-to-individuals: true
|
||||
|
Loading…
Reference in New Issue
Block a user