Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 1 | :title: Reporters |
| 2 | |
| 3 | Reporters |
| 4 | ========= |
| 5 | |
| 6 | Zuul can communicate results and progress back to configurable |
| 7 | protocols. For example, after succeeding in a build a pipeline can be |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 8 | configured to post a positive review back to Gerrit. |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 9 | |
| 10 | There are three stages when a report can be handled. That is on: |
| 11 | Start, Success or Failure. Each stage can have multiple reports. |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 12 | For example, you can set verified on Gerrit and send an email. |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 13 | |
| 14 | Gerrit |
| 15 | ------ |
| 16 | |
| 17 | Zuul works with standard versions of Gerrit by invoking the |
| 18 | ``gerrit`` command over an SSH connection. It reports back to |
| 19 | Gerrit using SSH. |
| 20 | |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 21 | The dictionary passed to the Gerrit reporter is used for ``gerrit |
Joshua Hesketh | 1879cf7 | 2013-08-19 14:13:15 +1000 | [diff] [blame] | 22 | review`` arguments, with the boolean value of ``true`` simply |
| 23 | indicating that the argument should be present without following it |
| 24 | with a value. For example, ``verified: 1`` becomes ``gerrit review |
| 25 | --verified 1`` and ``submit: true`` becomes ``gerrit review |
| 26 | --submit``. |
| 27 | |
| 28 | Gerrit Configuration |
| 29 | ~~~~~~~~~~~~~~~~~~~~ |
| 30 | |
Michael Prokop | 526926a | 2013-10-24 16:16:57 +0200 | [diff] [blame] | 31 | The configuration for posting back to Gerrit is shared with the Gerrit |
Joshua Hesketh | 5fea867 | 2013-08-19 17:32:01 +1000 | [diff] [blame] | 32 | trigger in zuul.conf as described in :ref:`zuulconf`. |
| 33 | |
| 34 | SMTP |
| 35 | ---- |
| 36 | |
| 37 | A simple email reporter is also available. |
| 38 | |
| 39 | SMTP Configuration |
| 40 | ~~~~~~~~~~~~~~~~~~ |
| 41 | |
Łukasz Jernaś | 048acb4 | 2014-03-02 18:49:41 +0100 | [diff] [blame] | 42 | zuul.conf contains the SMTP server and default to/from as described |
Joshua Hesketh | 5fea867 | 2013-08-19 17:32:01 +1000 | [diff] [blame] | 43 | in :ref:`zuulconf`. |
| 44 | |
Łukasz Jernaś | 048acb4 | 2014-03-02 18:49:41 +0100 | [diff] [blame] | 45 | Each pipeline can overwrite the ``subject`` or the ``to`` or ``from`` address by |
James E. Blair | e591020 | 2013-12-27 09:50:31 -0800 | [diff] [blame] | 46 | providing alternatives as arguments to the reporter. For example, :: |
Joshua Hesketh | 5fea867 | 2013-08-19 17:32:01 +1000 | [diff] [blame] | 47 | |
| 48 | pipelines: |
| 49 | - name: post-merge |
| 50 | manager: IndependentPipelineManager |
| 51 | trigger: |
| 52 | - event: change-merged |
| 53 | success: |
| 54 | smtp: |
| 55 | to: you@example.com |
| 56 | failure: |
| 57 | smtp: |
| 58 | to: you@example.com |
| 59 | from: alternative@example.com |
James E. Blair | e591020 | 2013-12-27 09:50:31 -0800 | [diff] [blame] | 60 | subject: Change {change} failed |