James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 1 | :title: Triggers |
| 2 | |
| 3 | Triggers |
| 4 | ======== |
| 5 | |
| 6 | The process of merging a change starts with proposing a change to be |
James E. Blair | c494d54 | 2014-08-06 09:23:52 -0700 | [diff] [blame] | 7 | merged. Primarily, Zuul supports Gerrit as a triggering system. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 8 | Zuul's design is modular, so alternate triggering and reporting |
James E. Blair | 63bb0ef | 2013-07-29 17:14:51 -0700 | [diff] [blame] | 9 | systems can be supported. |
James E. Blair | cdd0007 | 2012-06-08 19:17:28 -0700 | [diff] [blame] | 10 | |
| 11 | Gerrit |
| 12 | ------ |
| 13 | |
| 14 | Zuul works with standard versions of Gerrit by invoking the ``gerrit |
| 15 | stream-events`` command over an SSH connection. It also reports back |
| 16 | to Gerrit using SSH. |
| 17 | |
| 18 | Gerrit Configuration |
| 19 | ~~~~~~~~~~~~~~~~~~~~ |
| 20 | |
| 21 | Zuul will need access to a Gerrit user. Consider naming the user |
| 22 | *Jenkins* so that developers see that feedback from changes is from |
| 23 | Jenkins (Zuul attempts to stay out of the way of developers, most |
| 24 | shouldn't even need to know it's there). |
| 25 | |
| 26 | Create an SSH keypair for Zuul to use if there isn't one already, and |
| 27 | create a Gerrit user with that key:: |
| 28 | |
| 29 | cat ~/id_rsa.pub | ssh -p29418 gerrit.example.com gerrit create-account --ssh-key - --full-name Jenkins jenkins |
| 30 | |
| 31 | Give that user whatever permissions will be needed on the projects you |
| 32 | want Zuul to gate. For instance, you may want to grant ``Verified |
| 33 | +/-1`` and ``Submit`` to the user. Additional categories or values may |
| 34 | be added to Gerrit. Zuul is very flexible and can take advantage of |
| 35 | those. |
James E. Blair | 172c076 | 2012-10-02 15:35:54 -0700 | [diff] [blame] | 36 | |
David Pursehouse | 78556f7 | 2014-11-04 18:44:36 +0900 | [diff] [blame] | 37 | If using Gerrit 2.7 or later, make sure the user is a member of a group |
| 38 | that is granted the ``Stream Events`` permission, otherwise it will not |
| 39 | be able to invoke the ``gerrit stream-events`` command over SSH. |
| 40 | |
James E. Blair | 63bb0ef | 2013-07-29 17:14:51 -0700 | [diff] [blame] | 41 | Timer |
| 42 | ----- |
| 43 | |
| 44 | A simple timer trigger is available as well. It supports triggering |
| 45 | jobs in a pipeline based on cron-style time instructions. |
James E. Blair | c494d54 | 2014-08-06 09:23:52 -0700 | [diff] [blame] | 46 | |
| 47 | Zuul |
| 48 | ---- |
| 49 | |
| 50 | The Zuul trigger generates events based on internal actions in Zuul. |