Merge "Docs: reformat SMTP driver docs" into feature/zuulv3

This commit is contained in:
Jenkins 2017-08-04 21:33:17 +00:00 committed by Gerrit Code Review
commit d0e7aeae2a
2 changed files with 60 additions and 27 deletions

View File

@ -9,25 +9,36 @@ when items report.
Connection Configuration Connection Configuration
------------------------ ------------------------
**driver=smtp** .. attr:: <smtp connection>
.. attr:: driver
:required:
.. value:: smtp
The connection must set ``driver=smtp`` for SMTP connections.
.. attr:: server
:default: localhost
**server**
SMTP server hostname or address to use. SMTP server hostname or address to use.
``server=localhost``
**port** .. attr:: port
Optional: SMTP server port. :default: 25
``port=25``
SMTP server port.
.. attr:: default_from
:default: zuul
**default_from**
Who the email should appear to be sent from when emailing the report. Who the email should appear to be sent from when emailing the report.
This can be overridden by individual pipelines. This can be overridden by individual pipelines.
``default_from=zuul@example.com``
**default_to** .. attr:: default_to
:default: zuul
Who the report should be emailed to by default. Who the report should be emailed to by default.
This can be overridden by individual pipelines. This can be overridden by individual pipelines.
``default_to=you@example.com``
Reporter Configuration Reporter Configuration
---------------------- ----------------------
@ -39,7 +50,9 @@ reporter. The connection also may specify a default *To* or *From*
address. address.
Each pipeline can overwrite the ``subject`` or the ``to`` or ``from`` address by Each pipeline can overwrite the ``subject`` or the ``to`` or ``from`` address by
providing alternatives as arguments to the reporter. For example, :: providing alternatives as arguments to the reporter. For example:
.. code-block:: yaml
- pipeline: - pipeline:
name: post-merge name: post-merge
@ -51,3 +64,24 @@ providing alternatives as arguments to the reporter. For example, ::
to: you@example.com to: you@example.com
from: alternative@example.com from: alternative@example.com
subject: Change {change} failed subject: Change {change} failed
.. attr:: pipeline.<reporter>.<smtp source>
To report via email, the dictionaries passed to any of the pipeline
:ref:`reporter<reporters>` attributes support the following
attributes:
.. attr:: to
The SMTP recipient address for the report. Multiple addresses
may be specified as one value separated by commas.
.. attr:: from
The SMTP sender address for the report.
.. attr:: subject
The Subject of the report email.
.. TODO: document subject string formatting.

View File

@ -47,7 +47,6 @@ class SMTPReporter(BaseReporter):
def getSchema(): def getSchema():
smtp_reporter = v.Schema({ smtp_reporter = v.Schema({
'connection': str,
'to': str, 'to': str,
'from': str, 'from': str,
'subject': str, 'subject': str,