blob: 5b745e643430d49b6634c2709592fcff2fbd1457 [file] [log] [blame]
James E. Blaircdd00072012-06-08 19:17:28 -07001:title: Triggers
2
3Triggers
4========
5
6The process of merging a change starts with proposing a change to be
James E. Blairc494d542014-08-06 09:23:52 -07007merged. Primarily, Zuul supports Gerrit as a triggering system.
James E. Blaircdd00072012-06-08 19:17:28 -07008Zuul's design is modular, so alternate triggering and reporting
James E. Blair63bb0ef2013-07-29 17:14:51 -07009systems can be supported.
James E. Blaircdd00072012-06-08 19:17:28 -070010
11Gerrit
12------
13
14Zuul works with standard versions of Gerrit by invoking the ``gerrit
15stream-events`` command over an SSH connection. It also reports back
16to Gerrit using SSH.
17
18Gerrit Configuration
19~~~~~~~~~~~~~~~~~~~~
20
21Zuul will need access to a Gerrit user. Consider naming the user
22*Jenkins* so that developers see that feedback from changes is from
23Jenkins (Zuul attempts to stay out of the way of developers, most
24shouldn't even need to know it's there).
25
26Create an SSH keypair for Zuul to use if there isn't one already, and
27create 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
31Give that user whatever permissions will be needed on the projects you
32want Zuul to gate. For instance, you may want to grant ``Verified
33+/-1`` and ``Submit`` to the user. Additional categories or values may
34be added to Gerrit. Zuul is very flexible and can take advantage of
35those.
James E. Blair172c0762012-10-02 15:35:54 -070036
David Pursehouse78556f72014-11-04 18:44:36 +090037If using Gerrit 2.7 or later, make sure the user is a member of a group
38that is granted the ``Stream Events`` permission, otherwise it will not
39be able to invoke the ``gerrit stream-events`` command over SSH.
40
James E. Blair63bb0ef2013-07-29 17:14:51 -070041Timer
42-----
43
44A simple timer trigger is available as well. It supports triggering
45jobs in a pipeline based on cron-style time instructions.
James E. Blairc494d542014-08-06 09:23:52 -070046
47Zuul
48----
49
50The Zuul trigger generates events based on internal actions in Zuul.