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
|
:arg bool send-to-individuals: Send an email to the individual
|
||||||
who broke the build (default false)
|
who broke the build (default false)
|
||||||
|
|
||||||
Example::
|
Example:
|
||||||
|
|
||||||
publishers:
|
.. literalinclude:: /../../tests/publishers/fixtures/email001.yaml
|
||||||
- email:
|
:language: yaml
|
||||||
recipients: breakage@example.com
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: raise exception if this is applied to a maven job
|
# TODO: raise exception if this is applied to a maven job
|
||||||
mailer = XML.SubElement(xml_parent,
|
mailer = XML.SubElement(xml_parent,
|
||||||
'hudson.tasks.Mailer')
|
'hudson.tasks.Mailer')
|
||||||
if 'recipients' in data:
|
XML.SubElement(mailer, 'recipients').text = data.get('recipients', '')
|
||||||
XML.SubElement(mailer, 'recipients').text = data['recipients']
|
|
||||||
|
|
||||||
# Note the logic reversal (included here to match the GUI
|
# Note the logic reversal (included here to match the GUI
|
||||||
if data.get('notify-every-unstable-build', True):
|
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…
x
Reference in New Issue
Block a user