blob: b01c8d1df3a65423164845da067c9e81ee6cd8b1 [file] [log] [blame]
Joshua Hesketh1879cf72013-08-19 14:13:15 +10001:title: Reporters
2
3Reporters
4=========
5
6Zuul can communicate results and progress back to configurable
7protocols. For example, after succeeding in a build a pipeline can be
Michael Prokop526926a2013-10-24 16:16:57 +02008configured to post a positive review back to Gerrit.
Joshua Hesketh1879cf72013-08-19 14:13:15 +10009
10There are three stages when a report can be handled. That is on:
11Start, Success or Failure. Each stage can have multiple reports.
Michael Prokop526926a2013-10-24 16:16:57 +020012For example, you can set verified on Gerrit and send an email.
Joshua Hesketh1879cf72013-08-19 14:13:15 +100013
14Gerrit
15------
16
17Zuul works with standard versions of Gerrit by invoking the
18``gerrit`` command over an SSH connection. It reports back to
19Gerrit using SSH.
20
Michael Prokop526926a2013-10-24 16:16:57 +020021The dictionary passed to the Gerrit reporter is used for ``gerrit
Joshua Hesketh1879cf72013-08-19 14:13:15 +100022review`` arguments, with the boolean value of ``true`` simply
23indicating that the argument should be present without following it
24with a value. For example, ``verified: 1`` becomes ``gerrit review
25--verified 1`` and ``submit: true`` becomes ``gerrit review
26--submit``.
27
Joshua Heskethfe485c62015-08-11 23:42:34 +100028A :ref:`connection` that uses the gerrit driver must be supplied to the
29trigger.
Joshua Hesketh5fea8672013-08-19 17:32:01 +100030
31SMTP
32----
33
34A simple email reporter is also available.
35
Joshua Heskethfe485c62015-08-11 23:42:34 +100036A :ref:`connection` that uses the smtp driver must be supplied to the
Joshua Heskethd78b4482015-09-14 16:56:34 -060037reporter.
Joshua Heskethfe485c62015-08-11 23:42:34 +100038
Joshua Hesketh5fea8672013-08-19 17:32:01 +100039SMTP Configuration
40~~~~~~~~~~~~~~~~~~
41
Łukasz Jernaś048acb42014-03-02 18:49:41 +010042zuul.conf contains the SMTP server and default to/from as described
Joshua Hesketh5fea8672013-08-19 17:32:01 +100043in :ref:`zuulconf`.
44
Łukasz Jernaś048acb42014-03-02 18:49:41 +010045Each pipeline can overwrite the ``subject`` or the ``to`` or ``from`` address by
James E. Blaire5910202013-12-27 09:50:31 -080046providing alternatives as arguments to the reporter. For example, ::
Joshua Hesketh5fea8672013-08-19 17:32:01 +100047
48 pipelines:
49 - name: post-merge
50 manager: IndependentPipelineManager
Joshua Heskethfe485c62015-08-11 23:42:34 +100051 source: my_gerrit
Joshua Hesketh5fea8672013-08-19 17:32:01 +100052 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +100053 my_gerrit:
54 - event: change-merged
Joshua Hesketh5fea8672013-08-19 17:32:01 +100055 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +100056 outgoing_smtp:
Joshua Hesketh5fea8672013-08-19 17:32:01 +100057 to: you@example.com
58 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +100059 internal_smtp:
Joshua Hesketh5fea8672013-08-19 17:32:01 +100060 to: you@example.com
61 from: alternative@example.com
James E. Blaire5910202013-12-27 09:50:31 -080062 subject: Change {change} failed
Joshua Heskethd78b4482015-09-14 16:56:34 -060063
64SQL
65---
66
67This reporter is used to store results in a database.
68
69A :ref:`connection` that uses the sql driver must be supplied to the
70reporter.
71
72SQL Configuration
73~~~~~~~~~~~~~~~~~
74
75zuul.conf contains the database connection and credentials. To store different
76reports in different databases you'll need to create a new connection per
77database.
78
79The sql reporter is used to store the results from individual builds rather
80than the change. As such the sql reporter does nothing on "start" or
81"merge-failure".
82
83**score**
84 A score to store for the result of the build. eg: -1 might indicate a failed
85 build similar to the vote posted back via the gerrit reporter.
86
87For example ::
88
89 pipelines:
90 - name: post-merge
91 manager: IndependentPipelineManager
92 source: my_gerrit
93 trigger:
94 my_gerrit:
95 - event: change-merged
96 success:
97 mydb_conn:
98 score: 1
99 failure:
100 mydb_conn:
101 score: -1