blob: 700c9f75ac745e7e0349e004897a643774ee3cd3 [file] [log] [blame]
James E. Blaircdd00072012-06-08 19:17:28 -07001:title: Zuul
2
3Zuul
4====
5
6Configuration
7-------------
8
9Zuul has three configuration files:
10
11**zuul.conf**
James E. Blair1f4c2bb2013-04-26 08:40:46 -070012 Connection information for Gerrit and Gearman, locations of the
Łukasz Jernaś048acb42014-03-02 18:49:41 +010013 other config files.
James E. Blaircdd00072012-06-08 19:17:28 -070014**layout.yaml**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010015 Project and pipeline configuration -- what Zuul does.
James E. Blaircdd00072012-06-08 19:17:28 -070016**logging.conf**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010017 Python logging config.
James E. Blaircdd00072012-06-08 19:17:28 -070018
19Examples of each of the three files can be found in the etc/ directory
20of the source distribution.
21
James E. Blair6aea36d2012-12-17 13:03:24 -080022.. _zuulconf:
23
James E. Blaircdd00072012-06-08 19:17:28 -070024zuul.conf
25~~~~~~~~~
26
27Zuul will look for ``/etc/zuul/zuul.conf`` or ``~/zuul.conf`` to
28bootstrap its configuration. Alternately, you may specify ``-c
29/path/to/zuul.conf`` on the command line.
30
James E. Blair1f4c2bb2013-04-26 08:40:46 -070031Gerrit and Gearman connection information are each described in a
32section of zuul.conf. The location of the other two configuration
33files (as well as the location of the PID file when running Zuul as a
34server) are specified in a third section.
James E. Blaircdd00072012-06-08 19:17:28 -070035
Clark Boylan9b670902012-09-28 13:47:56 -070036The three sections of this config and their options are documented below.
37You can also find an example zuul.conf file in the git
38`repository
Andreas Jaegerbcfbf932014-09-29 20:21:44 +020039<https://git.openstack.org/cgit/openstack-infra/zuul/tree/etc/zuul.conf-sample>`_
Clark Boylan9b670902012-09-28 13:47:56 -070040
James E. Blair1f4c2bb2013-04-26 08:40:46 -070041gearman
Clark Boylan9b670902012-09-28 13:47:56 -070042"""""""
43
44**server**
James E. Blair1f4c2bb2013-04-26 08:40:46 -070045 Hostname or IP address of the Gearman server.
46 ``server=gearman.example.com``
Clark Boylan9b670902012-09-28 13:47:56 -070047
James E. Blair1f4c2bb2013-04-26 08:40:46 -070048**port**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010049 Port on which the Gearman server is listening.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070050 ``port=4730``
Clark Boylan9b670902012-09-28 13:47:56 -070051
James E. Blair77cc7b82013-07-15 13:22:37 -070052gearman_server
53""""""""""""""
54
55**start**
56 Whether to start the internal Gearman server (default: False).
57 ``start=true``
58
James E. Blair0ac452e2015-07-22 09:05:16 -070059**listen_address**
60 IP address or domain name on which to listen (default: all addresses).
61 ``listen_address=127.0.0.1``
62
James E. Blair77cc7b82013-07-15 13:22:37 -070063**log_config**
64 Path to log config file for internal Gearman server.
65 ``log_config=/etc/zuul/gearman-logging.yaml``
66
Clark Boylan9b670902012-09-28 13:47:56 -070067gerrit
68""""""
69
70**server**
71 FQDN of Gerrit server.
72 ``server=review.example.com``
73
Akihiro Motokic7d28a72014-03-22 09:21:38 +090074**port**
75 Optional: Gerrit server port.
76 ``port=29418``
77
Antoine Musso27475012012-11-26 09:53:01 +010078**baseurl**
79 Optional: path to Gerrit web interface. Defaults to ``https://<value
80 of server>/``. ``baseurl=https://review.example.com/review_site/``
81
Clark Boylan9b670902012-09-28 13:47:56 -070082**user**
83 User name to use when logging into above server via ssh.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070084 ``user=zuul``
Clark Boylan9b670902012-09-28 13:47:56 -070085
86**sshkey**
87 Path to SSH key to use when logging into above server.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070088 ``sshkey=/home/zuul/.ssh/id_rsa``
Clark Boylan9b670902012-09-28 13:47:56 -070089
90zuul
91""""
92
Antoine Musso9adc6d42014-11-14 15:37:48 +010093.. _layout_config:
94
Clark Boylan9b670902012-09-28 13:47:56 -070095**layout_config**
James E. Blair4076e2b2014-01-28 12:42:20 -080096 Path to layout config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070097 ``layout_config=/etc/zuul/layout.yaml``
98
99**log_config**
James E. Blaira4430132014-02-17 08:32:07 -0800100 Path to log config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700101 ``log_config=/etc/zuul/logging.yaml``
102
103**pidfile**
James E. Blaira4430132014-02-17 08:32:07 -0800104 Path to PID lock file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700105 ``pidfile=/var/run/zuul/zuul.pid``
106
107**state_dir**
James E. Blair4076e2b2014-01-28 12:42:20 -0800108 Path to directory that Zuul should save state to. Used by all Zuul
109 commands.
Clark Boylan9b670902012-09-28 13:47:56 -0700110 ``state_dir=/var/lib/zuul``
111
James E. Blair4076e2b2014-01-28 12:42:20 -0800112**report_times**
113 Boolean value (``true`` or ``false``) that determines if Zuul should
114 include elapsed times for each job in the textual report. Used by
115 zuul-server only.
116 ``report_times=true``
117
118**status_url**
119 URL that will be posted in Zuul comments made to Gerrit changes when
120 starting jobs for a change. Used by zuul-server only.
121 ``status_url=https://zuul.example.com/status``
122
Clark Boylane0b4bdb2014-06-03 17:01:25 -0700123**status_expiry**
124 Zuul will cache the status.json file for this many seconds. This is an
125 optional value and ``1`` is used by default.
126 ``status_expiry=1``
127
James E. Blair4076e2b2014-01-28 12:42:20 -0800128**url_pattern**
129 If you are storing build logs external to the system that originally
130 ran jobs and wish to link to those logs when Zuul makes comments on
131 Gerrit changes for completed jobs this setting configures what the
132 URLs for those links should be. Used by zuul-server only.
133 ``http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}``
134
135**job_name_in_report**
136 Boolean value (``true`` or ``false``) that indicates whether the
137 job name should be included in the report (normally only the URL
138 is included). Defaults to ``false``. Used by zuul-server only.
139 ``job_name_in_report=true``
140
141merger
142""""""
143
Clark Boylan9b670902012-09-28 13:47:56 -0700144**git_dir**
145 Directory that Zuul should clone local git repositories to.
146 ``git_dir=/var/lib/zuul/git``
147
Paul Belangerb67aba12013-05-13 19:22:14 -0400148**git_user_email**
149 Optional: Value to pass to `git config user.email`.
150 ``git_user_email=zuul@example.com``
151
152**git_user_name**
153 Optional: Value to pass to `git config user.name`.
154 ``git_user_name=zuul``
155
Arx Cruzb1b010d2013-10-28 19:49:59 -0200156**zuul_url**
James E. Blair4076e2b2014-01-28 12:42:20 -0800157 URL of this merger's git repos, accessible to test workers. Usually
158 "http://zuul.example.com/p" or "http://zuul-merger01.example.com/p"
159 depending on whether the merger is co-located with the Zuul server.
Arx Cruzb1b010d2013-10-28 19:49:59 -0200160
James E. Blaira4430132014-02-17 08:32:07 -0800161**log_config**
162 Path to log config file for the merger process.
163 ``log_config=/etc/zuul/logging.yaml``
164
165**pidfile**
166 Path to PID lock file for the merger process.
167 ``pidfile=/var/run/zuul-merger/merger.pid``
168
Joshua Hesketh5fea8672013-08-19 17:32:01 +1000169smtp
170""""
171
172**server**
173 SMTP server hostname or address to use.
174 ``server=localhost``
175
Akihiro Motokic7d28a72014-03-22 09:21:38 +0900176**port**
177 Optional: SMTP server port.
178 ``port=25``
179
Joshua Hesketh5fea8672013-08-19 17:32:01 +1000180**default_from**
181 Who the email should appear to be sent from when emailing the report.
182 This can be overridden by individual pipelines.
183 ``default_from=zuul@example.com``
184
185**default_to**
186 Who the report should be emailed to by default.
187 This can be overridden by individual pipelines.
188 ``default_to=you@example.com``
189
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100190.. _swift:
191
192swift
193"""""
194
195To send (optional) swift upload instructions this section must be
Antoine Musso62fa2d42014-06-04 22:55:23 +0200196present. Multiple destinations can be defined in the :ref:`jobs` section
197of the layout.
198
199If you are sending the temp-url-key or fetching the x-storage-url, you
200will need the python-swiftclient module installed.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100201
Joshua Heskethc4967502014-05-15 06:39:14 -0700202**X-Account-Meta-Temp-Url-Key** (optional)
203 This is the key used to sign the HMAC message. If you do not set a
204 key Zuul will generate one automatically.
205
206**Send-Temp-Url-Key** (optional)
207 Zuul can send the X-Account-Meta-Temp-Url-Key to swift for you if
208 you have set up the appropriate credentials in ``authurl`` below.
209 This isn't necessary if you know and have set your
210 X-Account-Meta-Temp-Url-Key.
Antoine Musso62fa2d42014-06-04 22:55:23 +0200211 If set, Zuul requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700212 ``default: true``
213
214**X-Storage-Url** (optional)
215 The storage URL is the destination to upload files into. If you do
216 not set this the ``authurl`` credentials are used to fetch the url
Antoine Musso62fa2d42014-06-04 22:55:23 +0200217 from swift and Zuul will requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700218
219**authurl** (optional)
220 The (keystone) Auth URL for swift.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100221 ``For example, https://identity.api.rackspacecloud.com/v2.0/``
Joshua Heskethc4967502014-05-15 06:39:14 -0700222 This is required if you have Send-Temp-Url-Key set to ``True`` or
223 if you have not supplied the X-Storage-Url.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100224
225Any of the `swiftclient connection parameters`_ can also be defined
226here by the same name. Including the os_options by their key name (
227``for example tenant_id``)
228
229.. _swiftclient connection parameters: http://docs.openstack.org/developer/python-swiftclient/swiftclient.html#module-swiftclient.client
230
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100231**region_name** (optional)
232 The region name holding the swift container
233 ``For example, SYD``
234
235Each destination defined by the :ref:`jobs` will have the following
236default values that it may overwrite.
237
238**default_container** (optional)
239 Container name to place the log into
240 ``For example, logs``
241
242**default_expiry** (optional)
243 How long the signed destination should be available for
244 ``default: 7200 (2hrs)``
245
246**default_max_file_size** (optional)
247 The maximum size of an individual file
248 ``default: 104857600 (100MB)``
249
250**default_max_file_count** (optional)
251 The maximum number of separate files to allow
252 ``default: 10``
253
254**default_logserver_prefix**
255 Provide a URL to the CDN or logserver app so that a worker knows
256 what URL to return. The worker should return the logserver_prefix
257 url and the object path.
258 ``For example: http://logs.example.org/server.app?obj=``
259
James E. Blaircdd00072012-06-08 19:17:28 -0700260layout.yaml
261~~~~~~~~~~~
262
Clark Boylan00635dc2012-09-19 14:03:08 -0700263This is the main configuration file for Zuul, where all of the pipelines
James E. Blaircdd00072012-06-08 19:17:28 -0700264and projects are defined, what tests should be run, and what actions
Clark Boylan00635dc2012-09-19 14:03:08 -0700265Zuul should perform. There are three sections: pipelines, jobs, and
James E. Blaircdd00072012-06-08 19:17:28 -0700266projects.
267
James E. Blaire5a847f2012-07-10 15:29:14 -0700268.. _includes:
269
270Includes
271""""""""
272
273Custom functions to be used in Zuul's configuration may be provided
274using the ``includes`` directive. It accepts a list of files to
275include, and currently supports one type of inclusion, a python file::
276
277 includes:
278 - python-file: local_functions.py
279
280**python-file**
Antoine Musso9adc6d42014-11-14 15:37:48 +0100281 The path to a python file (either an absolute path or relative to the
282 directory name of :ref:`layout_config <layout_config>`). The
283 file will be loaded and objects that it defines will be placed in a
284 special environment which can be referenced in the Zuul configuration.
285 Currently only the parameter-function attribute of a Job uses this
286 feature.
James E. Blaire5a847f2012-07-10 15:29:14 -0700287
Clark Boylan00635dc2012-09-19 14:03:08 -0700288Pipelines
289"""""""""
James E. Blaircdd00072012-06-08 19:17:28 -0700290
Clark Boylan00635dc2012-09-19 14:03:08 -0700291Zuul can have any number of independent pipelines. Whenever a matching
292Gerrit event is found for a pipeline, that event is added to the
293pipeline, and the jobs specified for that pipeline are run. When all
294jobs specified for the pipeline that were triggered by an event are
295completed, Zuul reports back to Gerrit the results.
James E. Blaircdd00072012-06-08 19:17:28 -0700296
Clark Boylan00635dc2012-09-19 14:03:08 -0700297There are no pre-defined pipelines in Zuul, rather you can define
298whatever pipelines you need in the layout file. This is a very flexible
299system that can accommodate many kinds of workflows.
James E. Blaircdd00072012-06-08 19:17:28 -0700300
Clark Boylan00635dc2012-09-19 14:03:08 -0700301Here is a quick example of a pipeline definition followed by an
James E. Blaircdd00072012-06-08 19:17:28 -0700302explanation of each of the parameters::
303
304 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700305 manager: IndependentPipelineManager
James E. Blairc0dedf82014-08-06 09:37:52 -0700306 source: gerrit
James E. Blaircdd00072012-06-08 19:17:28 -0700307 trigger:
James E. Blair6c358e72013-07-29 17:06:47 -0700308 gerrit:
309 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700310 success:
311 verified: 1
312 failure:
313 verified: -1
314
315**name**
316 This is used later in the project definition to indicate what jobs
Clark Boylan00635dc2012-09-19 14:03:08 -0700317 should be run for events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700318
James E. Blair8dbd56a2012-12-22 10:55:10 -0800319**description**
320 This is an optional field that may be used to provide a textual
321 description of the pipeline.
322
James E. Blairc0dedf82014-08-06 09:37:52 -0700323**source**
324 A required field that specifies a trigger that provides access to
325 the change objects that this pipeline operates on. Currently only
326 the value ``gerrit`` is supported.
327
James E. Blair56370192013-01-14 15:47:28 -0800328**success-message**
329 An optional field that supplies the introductory text in message
330 reported back to Gerrit when all the voting builds are successful.
331 Defaults to "Build successful."
332
333**failure-message**
334 An optional field that supplies the introductory text in message
335 reported back to Gerrit when at least one voting build fails.
336 Defaults to "Build failed."
337
Joshua Heskethb7179772014-01-30 23:30:46 +1100338**merge-failure-message**
339 An optional field that supplies the introductory text in message
340 reported back to Gerrit when a change fails to merge with the
341 current state of the repository.
342 Defaults to "Merge failed."
343
Joshua Hesketh3979e3e2014-03-04 11:21:10 +1100344**footer-message**
345 An optional field to supply additional information after test results.
346 Useful for adding information about the CI system such as debugging
347 and contact details.
348
James E. Blaircdd00072012-06-08 19:17:28 -0700349**manager**
Clark Boylan00635dc2012-09-19 14:03:08 -0700350 There are currently two schemes for managing pipelines:
James E. Blaircdd00072012-06-08 19:17:28 -0700351
Clark Boylan00635dc2012-09-19 14:03:08 -0700352 *IndependentPipelineManager*
353 Every event in this pipeline should be treated as independent of
354 other events in the pipeline. This is appropriate when the order of
355 events in the pipeline doesn't matter because the results of the
356 actions this pipeline performs can not affect other events in the
357 pipeline. For example, when a change is first uploaded for review,
James E. Blaircdd00072012-06-08 19:17:28 -0700358 you may want to run tests on that change to provide early feedback
359 to reviewers. At the end of the tests, the change is not going to
360 be merged, so it is safe to run these tests in parallel without
Clark Boylan00635dc2012-09-19 14:03:08 -0700361 regard to any other changes in the pipeline. They are independent.
James E. Blaircdd00072012-06-08 19:17:28 -0700362
Clark Boylan00635dc2012-09-19 14:03:08 -0700363 Another type of pipeline that is independent is a post-merge
364 pipeline. In that case, the changes have already merged, so the
365 results can not affect any other events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700366
Clark Boylan00635dc2012-09-19 14:03:08 -0700367 *DependentPipelineManager*
368 The dependent pipeline manager is designed for gating. It ensures
James E. Blaircdd00072012-06-08 19:17:28 -0700369 that every change is tested exactly as it is going to be merged
370 into the repository. An ideal gating system would test one change
371 at a time, applied to the tip of the repository, and only if that
372 change passed tests would it be merged. Then the next change in
373 line would be tested the same way. In order to achieve parallel
Clark Boylan00635dc2012-09-19 14:03:08 -0700374 testing of changes, the dependent pipeline manager performs
James E. Blaircdd00072012-06-08 19:17:28 -0700375 speculative execution on changes. It orders changes based on
Clark Boylan00635dc2012-09-19 14:03:08 -0700376 their entry into the pipeline. It begins testing all changes in
377 parallel, assuming that each change ahead in the pipeline will pass
James E. Blaircdd00072012-06-08 19:17:28 -0700378 its tests. If they all succeed, all the changes can be tested and
Clark Boylan00635dc2012-09-19 14:03:08 -0700379 merged in parallel. If a change near the front of the pipeline
380 fails its tests, each change behind it ignores whatever tests have
381 been completed and are tested again without the change in front.
382 This way gate tests may run in parallel but still be tested
383 correctly, exactly as they will appear in the repository when
384 merged.
James E. Blaircdd00072012-06-08 19:17:28 -0700385
Clark Boylan00635dc2012-09-19 14:03:08 -0700386 One important characteristic of the DependentPipelineManager is that
James E. Blaircdd00072012-06-08 19:17:28 -0700387 it analyzes the jobs that are triggered by different projects, and
388 if those projects have jobs in common, it treats those projects as
389 related, and they share a single virtual queue of changes. Thus,
390 if there is a job that performs integration testing on two
391 projects, those two projects will automatically share a virtual
392 change queue. If a third project does not invoke that job, it
Clark Boylan00635dc2012-09-19 14:03:08 -0700393 will be part of a separate virtual change queue, and changes to
394 it will not depend on changes to the first two jobs.
James E. Blaircdd00072012-06-08 19:17:28 -0700395
396 For more detail on the theory and operation of Zuul's
Clark Boylan00635dc2012-09-19 14:03:08 -0700397 DependentPipelineManager, see: :doc:`gating`.
James E. Blaircdd00072012-06-08 19:17:28 -0700398
399**trigger**
James E. Blairc494d542014-08-06 09:23:52 -0700400 At least one trigger source must be supplied for each pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700401 Triggers are not exclusive -- matching events may be placed in
James E. Blair6c358e72013-07-29 17:06:47 -0700402 multiple pipelines, and they will behave independently in each of
403 the pipelines they match. You may select from the following:
James E. Blaircdd00072012-06-08 19:17:28 -0700404
James E. Blair6c358e72013-07-29 17:06:47 -0700405 **gerrit**
406 This describes what Gerrit events should be placed in the
407 pipeline. Multiple gerrit triggers may be listed. Further
408 parameters describe the kind of events that match:
James E. Blaircdd00072012-06-08 19:17:28 -0700409
James E. Blair6c358e72013-07-29 17:06:47 -0700410 *event*
411 The event name from gerrit. Examples: ``patchset-created``,
412 ``comment-added``, ``ref-updated``. This field is treated as a
413 regular expression.
James E. Blaircdd00072012-06-08 19:17:28 -0700414
James E. Blair6c358e72013-07-29 17:06:47 -0700415 *branch*
416 The branch associated with the event. Example: ``master``. This
417 field is treated as a regular expression, and multiple branches may
418 be listed.
James E. Blaircdd00072012-06-08 19:17:28 -0700419
James E. Blair6c358e72013-07-29 17:06:47 -0700420 *ref*
421 On ref-updated events, the branch parameter is not used, instead the
422 ref is provided. Currently Gerrit has the somewhat idiosyncratic
423 behavior of specifying bare refs for branch names (e.g., ``master``),
424 but full ref names for other kinds of refs (e.g., ``refs/tags/foo``).
425 Zuul matches what you put here exactly against what Gerrit
426 provides. This field is treated as a regular expression, and
427 multiple refs may be listed.
James E. Blaircdd00072012-06-08 19:17:28 -0700428
K Jonathan Harkerf95e7232015-04-29 13:33:16 -0700429 *ignore-deletes*
430 When a branch is deleted, a ref-updated event is emitted with a newrev
431 of all zeros specified. The ``ignore-deletes`` field is a boolean value
432 that describes whether or not these newrevs trigger ref-updated events.
433 The default is True, which will not trigger ref-updated events.
434
James E. Blair6c358e72013-07-29 17:06:47 -0700435 *approval*
436 This is only used for ``comment-added`` events. It only matches if
437 the event has a matching approval associated with it. Example:
438 ``code-review: 2`` matches a ``+2`` vote on the code review category.
439 Multiple approvals may be listed.
Antoine Mussob4e809e2012-12-06 16:58:06 +0100440
James E. Blair1fbfceb2014-06-23 14:42:53 -0700441 *email*
James E. Blair6c358e72013-07-29 17:06:47 -0700442 This is used for any event. It takes a regex applied on the performer
Michael Prokop526926a2013-10-24 16:16:57 +0200443 email, i.e. Gerrit account email address. If you want to specify
James E. Blair6c358e72013-07-29 17:06:47 -0700444 several email filters, you must use a YAML list. Make sure to use non
445 greedy matchers and to escapes dots!
James E. Blair1fbfceb2014-06-23 14:42:53 -0700446 Example: ``email: ^.*?@example\.org$``.
James E. Blair6c358e72013-07-29 17:06:47 -0700447
James E. Blair1fbfceb2014-06-23 14:42:53 -0700448 *email_filter* (deprecated)
449 A deprecated alternate spelling of *email*. Only one of *email* or
450 *email_filter* should be used.
451
452 *username*
Joshua Heskethb8a817e2013-12-27 11:21:38 +1100453 This is used for any event. It takes a regex applied on the performer
454 username, i.e. Gerrit account name. If you want to specify several
455 username filters, you must use a YAML list. Make sure to use non greedy
456 matchers and to escapes dots!
James E. Blair1fbfceb2014-06-23 14:42:53 -0700457 Example: ``username: ^jenkins$``.
Joshua Heskethb8a817e2013-12-27 11:21:38 +1100458
James E. Blair1fbfceb2014-06-23 14:42:53 -0700459 *username_filter* (deprecated)
460 A deprecated alternate spelling of *username*. Only one of *username* or
461 *username_filter* should be used.
462
463 *comment*
James E. Blair6c358e72013-07-29 17:06:47 -0700464 This is only used for ``comment-added`` events. It accepts a list of
465 regexes that are searched for in the comment string. If any of these
466 regexes matches a portion of the comment string the trigger is
James E. Blair1fbfceb2014-06-23 14:42:53 -0700467 matched. ``comment: retrigger`` will match when comments
James E. Blair6c358e72013-07-29 17:06:47 -0700468 containing 'retrigger' somewhere in the comment text are added to a
469 change.
Clark Boylanb9bcb402012-06-29 17:44:05 -0700470
James E. Blair1fbfceb2014-06-23 14:42:53 -0700471 *comment_filter* (deprecated)
472 A deprecated alternate spelling of *comment*. Only one of *comment* or
473 *comment_filter* should be used.
474
James E. Blair5bf78a32015-07-30 18:08:24 +0000475 *require-approval*
James E. Blairc053d022014-01-22 14:57:33 -0800476 This may be used for any event. It requires that a certain kind
477 of approval be present for the current patchset of the change (the
James E. Blair11041d22014-05-02 14:49:53 -0700478 approval could be added by the event in question). It follows the
Antoine Musso27ab0d52014-10-22 14:20:17 +0200479 same syntax as the :ref:`"approval" pipeline requirement below
Joshua Hesketh66c8e522014-06-26 15:30:08 +1000480 <pipeline-require-approval>`. For each specified criteria there must
481 exist a matching approval.
482
483 *reject-approval*
484 This takes a list of approvals in the same format as
485 *require-approval* but will fail to enter the pipeline if there is
486 a matching approval.
James E. Blairc053d022014-01-22 14:57:33 -0800487
James E. Blair63bb0ef2013-07-29 17:14:51 -0700488 **timer**
489 This trigger will run based on a cron-style time specification.
490 It will enqueue an event into its pipeline for every project
491 defined in the configuration. Any job associated with the
492 pipeline will run in response to that event.
493
494 *time*
495 The time specification in cron syntax. Only the 5 part syntax is
496 supported, not the symbolic names. Example: ``0 0 * * *`` runs
497 at midnight.
498
James E. Blairc494d542014-08-06 09:23:52 -0700499 **zuul**
500 This trigger supplies events generated internally by Zuul.
501 Multiple events may be listed.
502
503 *event*
504 The event name. Currently supported:
505
506 *project-change-merged* when Zuul merges a change to a project,
507 it generates this event for every open change in the project.
508
509 *parent-change-enqueued* when Zuul enqueues a change into any
510 pipeline, it generates this event for every child of that
511 change.
512
513 *pipeline*
514 Only available for ``parent-change-enqueued`` events. This is the
515 name of the pipeline in which the parent change was enqueued.
516
517 *require-approval*
518 This may be used for any event. It requires that a certain kind
519 of approval be present for the current patchset of the change (the
520 approval could be added by the event in question). It follows the
Antoine Musso27ab0d52014-10-22 14:20:17 +0200521 same syntax as the :ref:`"approval" pipeline requirement below
Joshua Hesketh66c8e522014-06-26 15:30:08 +1000522 <pipeline-require-approval>`. For each specified criteria there must
523 exist a matching approval.
524
525 *reject-approval*
526 This takes a list of approvals in the same format as
527 *require-approval* but will fail to enter the pipeline if there is
528 a matching approval.
James E. Blairc494d542014-08-06 09:23:52 -0700529
530
James E. Blair11041d22014-05-02 14:49:53 -0700531**require**
532 If this section is present, it established pre-requisites for any
533 kind of item entering the Pipeline. Regardless of how the item is
534 to be enqueued (via any trigger or automatic dependency resolution),
535 the conditions specified here must be met or the item will not be
536 enqueued.
537
Antoine Musso27ab0d52014-10-22 14:20:17 +0200538.. _pipeline-require-approval:
539
James E. Blair5bf78a32015-07-30 18:08:24 +0000540 **approval**
James E. Blair11041d22014-05-02 14:49:53 -0700541 This requires that a certain kind of approval be present for the
542 current patchset of the change (the approval could be added by the
543 event in question). It takes several sub-parameters, all of which
544 are optional and are combined together so that there must be an
545 approval matching all specified requirements.
546
547 *username*
548 If present, an approval from this username is required.
549
James E. Blair1fbfceb2014-06-23 14:42:53 -0700550 *email*
James E. Blair11041d22014-05-02 14:49:53 -0700551 If present, an approval with this email address is required. It
552 is treated as a regular expression as above.
553
James E. Blair1fbfceb2014-06-23 14:42:53 -0700554 *email-filter* (deprecated)
555 A deprecated alternate spelling of *email*. Only one of *email* or
556 *email_filter* should be used.
557
James E. Blair11041d22014-05-02 14:49:53 -0700558 *older-than*
559 If present, the approval must be older than this amount of time
560 to match. Provide a time interval as a number with a suffix of
561 "w" (weeks), "d" (days), "h" (hours), "m" (minutes), "s"
562 (seconds). Example ``48h`` or ``2d``.
563
564 *newer-than*
565 If present, the approval must be newer than this amount of time
566 to match. Same format as "older-than".
567
568 Any other field is interpreted as a review category and value
569 pair. For example ``verified: 1`` would require that the approval
James E. Blair9c17dbf2014-06-23 14:21:58 -0700570 be for a +1 vote in the "Verified" column. The value may either
571 be a single value or a list: ``verified: [1, 2]`` would match
572 either a +1 or +2 vote.
James E. Blair11041d22014-05-02 14:49:53 -0700573
574 **open**
575 A boolean value (``true`` or ``false``) that indicates whether the change
576 must be open or closed in order to be enqueued.
577
Clark Boylana9702ad2014-05-08 17:17:24 -0700578 **current-patchset**
579 A boolean value (``true`` or ``false``) that indicates whether the change
580 must be the current patchset in order to be enqueued.
581
James E. Blair11041d22014-05-02 14:49:53 -0700582 **status**
583 A string value that corresponds with the status of the change
584 reported by the trigger. For example, when using the Gerrit
585 trigger, status values such as ``NEW`` or ``MERGED`` may be useful.
James E. Blair63bb0ef2013-07-29 17:14:51 -0700586
Joshua Hesketh66c8e522014-06-26 15:30:08 +1000587**reject**
588 If this section is present, it establishes pre-requisites that can
589 block an item from being enqueued. It can be considered a negative
590 version of **require**.
591
592 **approval**
593 This takes a list of approvals. If an approval matches the provided
594 criteria the change can not be entered into the pipeline. It follows
595 the same syntax as the :ref:`"require approval" pipeline above
596 <pipeline-require-approval>`.
597
598 Example to reject a change with any negative vote::
599
600 reject:
601 approval:
602 - code-review: [-1, -2]
603
James E. Blair2fa50962013-01-30 21:50:41 -0800604**dequeue-on-new-patchset**
605 Normally, if a new patchset is uploaded to a change that is in a
606 pipeline, the existing entry in the pipeline will be removed (with
607 jobs canceled and any dependent changes that can no longer merge as
608 well. To suppress this behavior (and allow jobs to continue
609 running), set this to ``false``. Default: ``true``.
610
James E. Blair17dd6772015-02-09 14:45:18 -0800611**ignore-dependencies**
612 In any kind of pipeline (dependent or independent), Zuul will
613 attempt to enqueue all dependencies ahead of the current change so
614 that they are tested together (independent pipelines report the
615 results of each change regardless of the results of changes ahead).
616 To ignore dependencies completely in an independent pipeline, set
617 this to ``true``. This option is ignored by dependent pipelines.
618 The default is: ``false``.
619
James E. Blaircdd00072012-06-08 19:17:28 -0700620**success**
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000621 Describes where Zuul should report to if all the jobs complete
622 successfully.
James E. Blaircdd00072012-06-08 19:17:28 -0700623 This section is optional; if it is omitted, Zuul will run jobs and
624 do nothing on success; it will not even report a message to Gerrit.
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000625 If the section is present, the listed reporter plugins will be
626 asked to report on the jobs.
627 Each reporter's value dictionary is handled by the reporter. See
628 reporters for more details.
James E. Blaircdd00072012-06-08 19:17:28 -0700629
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400630**failure**
James E. Blaircdd00072012-06-08 19:17:28 -0700631 Uses the same syntax as **success**, but describes what Zuul should
632 do if at least one job fails.
James E. Blairdc253862012-06-13 17:12:42 -0700633
Joshua Heskethb7179772014-01-30 23:30:46 +1100634**merge-failure**
635 Uses the same syntax as **success**, but describes what Zuul should
636 do if it is unable to merge in the patchset. If no merge-failure
637 reporters are listed then the ``failure`` reporters will be used to
638 notify of unsuccessful merges.
639
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400640**start**
James E. Blairdc253862012-06-13 17:12:42 -0700641 Uses the same syntax as **success**, but describes what Zuul should
Clark Boylan00635dc2012-09-19 14:03:08 -0700642 do when a change is added to the pipeline manager. This can be used,
James E. Blairdc253862012-06-13 17:12:42 -0700643 for example, to reset the value of the Verified review category.
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400644
Joshua Hesketh89e829d2015-02-10 16:29:45 +1100645**disabled**
646 Uses the same syntax as **success**, but describes what Zuul should
647 do when a pipeline is disabled.
648 See ``disable-after-consecutive-failures``.
649
650**disable-after-consecutive-failures**
651 If set, a pipeline can enter a ''disabled'' state if too many changes
652 in a row fail. When this value is exceeded the pipeline will stop
653 reporting to any of the ``success``, ``failure`` or ``merge-failure``
654 reporters and instead only report to the ``disabled`` reporters.
655 (No ``start`` reports are made when a pipeline is disabled).
656
James E. Blair64ed6f22013-07-10 14:07:23 -0700657**precedence**
658 Indicates how the build scheduler should prioritize jobs for
659 different pipelines. Each pipeline may have one precedence, jobs
660 for pipelines with a higher precedence will be run before ones with
661 lower. The value should be one of ``high``, ``normal``, or ``low``.
662 Default: ``normal``.
663
Clark Boylanc2d19e42014-01-23 14:08:58 -0800664**window**
665 DependentPipelineManagers only. Zuul can rate limit
666 DependentPipelineManagers in a manner similar to TCP flow control.
667 Jobs are only started for changes in the queue if they sit in the
668 actionable window for the pipeline. The initial length of this window
669 is configurable with this value. The value given should be a positive
670 integer value. A value of ``0`` disables rate limiting on the
671 DependentPipelineManager.
672 Default: ``20``.
673
674**window-floor**
675 DependentPipelineManagers only. This is the minimum value for the
676 window described above. Should be a positive non zero integer value.
677 Default: ``3``.
678
679**window-increase-type**
680 DependentPipelineManagers only. This value describes how the window
681 should grow when changes are successfully merged by zuul. A value of
682 ``linear`` indicates that ``window-increase-factor`` should be added
683 to the previous window value. A value of ``exponential`` indicates
684 that ``window-increase-factor`` should be multiplied against the
685 previous window value and the result will become the window size.
686 Default: ``linear``.
687
688**window-increase-factor**
Clint Adams041ae512015-06-16 20:02:29 -0400689 DependentPipelineManagers only. The value to be added or multiplied
Clark Boylanc2d19e42014-01-23 14:08:58 -0800690 against the previous window value to determine the new window after
691 successful change merges.
692 Default: ``1``.
693
694**window-decrease-type**
695 DependentPipelineManagers only. This value describes how the window
696 should shrink when changes are not able to be merged by Zuul. A value
697 of ``linear`` indicates that ``window-decrease-factor`` should be
698 subtracted from the previous window value. A value of ``exponential``
699 indicates that ``window-decrease-factor`` should be divided against
700 the previous window value and the result will become the window size.
701 Default: ``exponential``.
702
703**window-decrease-factor**
704 DependentPipelineManagers only. The value to be subtracted or divided
705 against the previous window value to determine the new window after
706 unsuccessful change merges.
707 Default: ``2``.
708
Clark Boylan00635dc2012-09-19 14:03:08 -0700709Some example pipeline configurations are included in the sample layout
710file. The first is called a *check* pipeline::
James E. Blaircdd00072012-06-08 19:17:28 -0700711
712 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700713 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700714 trigger:
715 - event: patchset-created
716 success:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000717 gerrit:
718 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700719 failure:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000720 gerrit:
721 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700722
723This will trigger jobs each time a new patchset (or change) is
724uploaded to Gerrit, and report +/-1 values to Gerrit in the
725``verified`` review category. ::
726
727 - name: gate
Clark Boylan00635dc2012-09-19 14:03:08 -0700728 manager: DependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700729 trigger:
730 - event: comment-added
731 approval:
732 - approved: 1
733 success:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000734 gerrit:
735 verified: 2
736 submit: true
James E. Blaircdd00072012-06-08 19:17:28 -0700737 failure:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000738 gerrit:
739 verified: -2
James E. Blaircdd00072012-06-08 19:17:28 -0700740
741This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the
742``approved`` review category in Gerrit (a non-standard category).
743Changes will be tested in such a way as to guarantee that they will be
744merged exactly as tested, though that will happen in parallel by
745creating a virtual queue of dependent changes and performing
746speculative execution of jobs. ::
747
748 - name: post
Clark Boylan00635dc2012-09-19 14:03:08 -0700749 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700750 trigger:
751 - event: ref-updated
752 ref: ^(?!refs/).*$
753
754This will trigger jobs whenever a change is merged to a named branch
755(e.g., ``master``). No output will be reported to Gerrit. This is
756useful for side effects such as creating per-commit tarballs. ::
757
758 - name: silent
Clark Boylan00635dc2012-09-19 14:03:08 -0700759 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700760 trigger:
761 - event: patchset-created
762
763This also triggers jobs when changes are uploaded to Gerrit, but no
764results are reported to Gerrit. This is useful for jobs that are in
Antoine Mussoce333842012-10-16 14:42:35 +0200765development and not yet ready to be presented to developers. ::
766
767 pipelines:
768 - name: post-merge
769 manager: IndependentPipelineManager
770 trigger:
771 - event: change-merged
772 success:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000773 gerrit:
774 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200775 failure:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000776 gerrit:
777 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200778
779The ``change-merged`` events happen when a change has been merged in the git
780repository. The change is thus closed and Gerrit will not accept modifications
781to the review scoring such as ``code-review`` or ``verified``. By using the
782``force-message: True`` parameter, Zuul will pass ``--force-message`` to the
783``gerrit review`` command, thus making sure the message is actually
784sent back to Gerrit regardless of approval scores.
785That kind of pipeline is nice to run regression or performance tests.
786
787.. note::
788 The ``change-merged`` event does not include the commit sha1 which can be
789 hazardous, it would let you report back to Gerrit though. If you were to
Michael Prokop526926a2013-10-24 16:16:57 +0200790 build a tarball for a specific commit, you should consider instead using
Łukasz Jernaś048acb42014-03-02 18:49:41 +0100791 the ``ref-updated`` event which does include the commit sha1 (but lacks the
Antoine Mussoce333842012-10-16 14:42:35 +0200792 Gerrit change number).
James E. Blaircdd00072012-06-08 19:17:28 -0700793
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100794
795.. _jobs:
796
James E. Blaircdd00072012-06-08 19:17:28 -0700797Jobs
798""""
799
800The jobs section is optional, and can be used to set attributes of
801jobs that are independent of their association with a project. For
802example, if a job should return a customized message on failure, that
803may be specified here. Otherwise, Zuul does not need to be told about
804each job as it builds a list from the project specification.
805
806**name**
807 The name of the job. This field is treated as a regular expression
808 and will be applied to each job that matches.
809
James E. Blairc8a1e052014-02-25 09:29:26 -0800810**queue-name (optional)**
811 Zuul will automatically combine projects that share a job into
812 shared change queues for dependent pipeline managers. In order to
813 report statistics about these queues, it is convenient for them to
814 have names. Zuul can automatically name change queues, however
815 these can grow quite long and are prone to changing as projects in
816 the queue change. If you assign a queue-name to a job, Zuul will
817 use that as the name for the shared change queue that contains that
818 job instead of the automatically generated one. It is an error for
819 a shared change queue to have more than one job with a queue-name if
820 they are not the same.
821
James E. Blaire5a847f2012-07-10 15:29:14 -0700822**failure-message (optional)**
823 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700824
James E. Blaire5a847f2012-07-10 15:29:14 -0700825**success-message (optional)**
826 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700827
James E. Blair6aea36d2012-12-17 13:03:24 -0800828**failure-pattern (optional)**
829 The URL that should be reported to Gerrit if the job fails.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700830 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800831 zuul.conf. May be supplied as a string pattern with substitutions
832 as described in url_pattern in :ref:`zuulconf`.
833
834**success-pattern (optional)**
835 The URL that should be reported to Gerrit if the job succeeds.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700836 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800837 zuul.conf. May be supplied as a string pattern with substitutions
838 as described in url_pattern in :ref:`zuulconf`.
839
James E. Blair222d4982012-07-16 09:31:19 -0700840**hold-following-changes (optional)**
841 This is a boolean that indicates that changes that follow this
Clark Boylan00635dc2012-09-19 14:03:08 -0700842 change in a dependent change pipeline should wait until this job
James E. Blair222d4982012-07-16 09:31:19 -0700843 succeeds before launching. If this is applied to a very short job
844 that can predict whether longer jobs will fail early, this can be
845 used to reduce the number of jobs that Zuul will launch and
846 ultimately have to cancel. In that case, a small amount of
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400847 parallelization of jobs is traded for more efficient use of testing
James E. Blair222d4982012-07-16 09:31:19 -0700848 resources. On the other hand, to apply this to a long running job
849 would largely defeat the parallelization of dependent change testing
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400850 that is the main feature of Zuul. Default: ``false``.
James E. Blair222d4982012-07-16 09:31:19 -0700851
James E. Blaire5a847f2012-07-10 15:29:14 -0700852**branch (optional)**
James E. Blaircdd00072012-06-08 19:17:28 -0700853 This job should only be run on matching branches. This field is
854 treated as a regular expression and multiple branches may be
855 listed.
856
James E. Blair70c71582013-03-06 08:50:50 -0800857**files (optional)**
858 This job should only be run if at least one of the files involved in
859 the change (added, deleted, or modified) matches at least one of the
860 file patterns listed here. This field is treated as a regular
861 expression and multiple expressions may be listed.
862
Maru Newby3fe5f852015-01-13 04:22:14 +0000863**skip-if (optional)**
864
865 This job should not be run if all the patterns specified by the
866 optional fields listed below match on their targets. When multiple
867 sets of parameters are provided, this job will be skipped if any set
868 matches. For example: ::
869
870 jobs:
871 - name: check-tempest-dsvm-neutron
872 skip-if:
873 - project: ^openstack/neutron$
874 branch: ^stable/juno$
875 all-files-match-any:
876 - ^neutron/tests/.*$
877 - ^tools/.*$
878 - all-files-match-any:
879 - ^doc/.*$
880 - ^.*\.rst$
881
882 With this configuration, the job would be skipped for a neutron
883 patchset for the stable/juno branch provided that every file in the
884 change matched at least one of the specified file regexes. The job
885 will also be skipped for any patchset that modified only the doc
886 tree or rst files.
887
888 *project* (optional)
889 The regular expression to match against the project of the change.
890
891 *branch* (optional)
892 The regular expression to match against the branch or ref of the
893 change.
894
895 *all-files-match-any* (optional)
896 A list of regular expressions intended to match the files involved
897 in the change. This parameter will be considered matching a
898 change only if all files in a change match at least one of these
899 expressions.
900
901 The pattern for '/COMMIT_MSG' is always matched on and does not
902 have to be included.
903
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400904**voting (optional)**
905 Boolean value (``true`` or ``false``) that indicates whatever
906 a job is voting or not. Default: ``true``.
907
James E. Blaire5a847f2012-07-10 15:29:14 -0700908**parameter-function (optional)**
909 Specifies a function that should be applied to the parameters before
910 the job is launched. The function should be defined in a python file
911 included with the :ref:`includes` directive. The function
912 should have the following signature:
913
James E. Blaird0470972013-07-29 10:05:43 -0700914 .. function:: parameters(item, job, parameters)
James E. Blaire5a847f2012-07-10 15:29:14 -0700915
916 Manipulate the parameters passed to a job before a build is
917 launched. The ``parameters`` dictionary will already contain the
918 standard Zuul job parameters, and is expected to be modified
919 in-place.
920
James E. Blaird78576a2013-07-09 10:39:17 -0700921 :param item: the current queue item
922 :type item: zuul.model.QueueItem
James E. Blaird0470972013-07-29 10:05:43 -0700923 :param job: the job about to be run
924 :type job: zuul.model.Job
James E. Blaire5a847f2012-07-10 15:29:14 -0700925 :param parameters: parameters to be passed to the job
926 :type parameters: dict
927
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700928 If the parameter **ZUUL_NODE** is set by this function, then it will
929 be used to specify on what node (or class of node) the job should be
930 run.
931
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100932**swift**
933 If :ref:`swift` is configured then each job can define a destination
934 container for the builder to place logs and/or assets into. Multiple
935 containers can be listed for each job by providing a unique ``name``.
936
937 *name*
938 Set an identifying name for the container. This is used in the
939 parameter key sent to the builder. For example if it ``logs`` then
940 one of the parameters sent will be ``SWIFT_logs_CONTAINER``
941 (case-sensitive).
942
943 Each of the defaults defined in :ref:`swift` can be overwritten as:
944
945 *container* (optional)
946 Container name to place the log into
947 ``For example, logs``
948
949 *expiry* (optional)
950 How long the signed destination should be available for
951
James E. Blaird6500232014-06-23 15:05:48 -0700952 *max-file-size** (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100953 The maximum size of an individual file
954
James E. Blaird6500232014-06-23 15:05:48 -0700955 *max_file_size** (optional, deprecated)
956 A deprecated alternate spelling of *max-file-size*.
957
958 *max-file-count* (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100959 The maximum number of separate files to allow
960
James E. Blaird6500232014-06-23 15:05:48 -0700961 *max_file_count* (optional, deprecated)
962 A deprecated alternate spelling of *max-file-count*.
963
964 *logserver-prefix*
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100965 Provide a URL to the CDN or logserver app so that a worker knows
966 what URL to return.
967 ``For example: http://logs.example.org/server.app?obj=``
James E. Blaird6500232014-06-23 15:05:48 -0700968 The worker should return the logserver-prefix url and the object
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100969 path as the URL in the results data packet.
970
James E. Blaird6500232014-06-23 15:05:48 -0700971 *logserver_prefix* (deprecated)
972 A deprecated alternate spelling of *logserver-prefix*.
973
James E. Blaircdd00072012-06-08 19:17:28 -0700974Here is an example of setting the failure message for jobs that check
975whether a change merges cleanly::
976
977 - name: ^.*-merge$
Jeremy Stanley1c2c3c22015-06-15 21:23:19 +0000978 failure-message: This change or one of its cross-repo dependencies
979 was unable to be automatically merged with the current state of
980 its repository. Please rebase the change and upload a new
981 patchset.
James E. Blaircdd00072012-06-08 19:17:28 -0700982
983Projects
984""""""""
985
Clark Boylan00635dc2012-09-19 14:03:08 -0700986The projects section indicates what jobs should be run in each pipeline
James E. Blaircdd00072012-06-08 19:17:28 -0700987for events associated with each project. It contains a list of
988projects. Here is an example::
989
990 - name: example/project
991 check:
992 - project-merge:
993 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700994 - project-pep8
995 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700996 gate:
997 - project-merge:
998 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700999 - project-pep8
1000 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -07001001 post:
1002 - project-publish
1003
1004**name**
1005 The name of the project (as known by Gerrit).
1006
James E. Blair19deff22013-08-25 13:17:35 -07001007**merge-mode (optional)**
1008 An optional value that indicates what strategy should be used to
1009 merge changes to this project. Supported values are:
1010
1011 ** merge-resolve **
1012 Equivalent to 'git merge -s resolve'. This corresponds closely to
1013 what Gerrit performs (using JGit) for a project if the "Merge if
1014 necessary" merge mode is selected and "Automatically resolve
1015 conflicts" is checked. This is the default.
1016
1017 ** merge **
1018 Equivalent to 'git merge'.
1019
1020 ** cherry-pick **
1021 Equivalent to 'git cherry-pick'.
1022
Clark Boylan00635dc2012-09-19 14:03:08 -07001023This is followed by a section for each of the pipelines defined above.
1024Pipelines may be omitted if no jobs should run for this project in a
1025given pipeline. Within the pipeline section, the jobs that should be
James E. Blaircdd00072012-06-08 19:17:28 -07001026executed are listed. If a job is entered as a dictionary key, then
1027jobs contained within that key are only executed if the key job
1028succeeds. In the above example, project-unittest, project-pep8, and
1029project-pyflakes are only executed if project-merge succeeds. This
1030can help avoid running unnecessary jobs.
1031
James E. Blair18c64442014-03-18 10:14:45 -07001032The special job named ``noop`` is internal to Zuul and will always
1033return ``SUCCESS`` immediately. This can be useful if you require
1034that all changes be processed by a pipeline but a project has no jobs
1035that can be run on it.
1036
Andreas Jaegerbcfbf932014-09-29 20:21:44 +02001037.. seealso:: The OpenStack Zuul configuration for a comprehensive example: https://git.openstack.org/cgit/openstack-infra/project-config/tree/zuul/layout.yaml
James E. Blaircdd00072012-06-08 19:17:28 -07001038
Antoine Musso80edd5a2013-02-13 15:37:53 +01001039Project Templates
1040"""""""""""""""""
1041
Michael Prokop526926a2013-10-24 16:16:57 +02001042Whenever you have lot of similar projects (such as plugins for a project) you
Antoine Musso80edd5a2013-02-13 15:37:53 +01001043will most probably want to use the same pipeline configurations. The
1044project templates let you define pipelines and job name templates to trigger.
1045One can then just apply the template on its project which make it easier to
Michael Prokop526926a2013-10-24 16:16:57 +02001046update several similar projects. As an example::
Antoine Musso80edd5a2013-02-13 15:37:53 +01001047
1048 project-templates:
1049 # Name of the template
1050 - name: plugin-triggering
1051 # Definition of pipelines just like for a `project`
1052 check:
1053 - '{jobprefix}-merge':
1054 - '{jobprefix}-pep8'
1055 - '{jobprefix}-pyflakes'
1056 gate:
1057 - '{jobprefix}-merge':
1058 - '{jobprefix}-unittest'
1059 - '{jobprefix}-pep8'
1060 - '{jobprefix}-pyflakes'
1061
1062In your projects definition, you will then apply the template using the template
1063key::
1064
1065 projects:
1066 - name: plugin/foobar
1067 template:
1068 - name: plugin-triggering
1069 jobprefix: plugin-foobar
1070
James E. Blairaea6cf62013-12-16 15:38:12 -08001071You can pass several parameters to a template. A ``parameter`` value
1072will be used for expansion of ``{parameter}`` in the template
1073strings. The parameter ``name`` will be automatically provided and
1074will contain the short name of the project, that is the portion of the
1075project name after the last ``/`` character.
James E. Blaircdd00072012-06-08 19:17:28 -07001076
James E. Blair3e98c022013-12-16 15:25:38 -08001077Multiple templates can be combined in a project, and the jobs from all
1078of those templates will be added to the project. Individual jobs may
1079also be added::
1080
1081 projects:
1082 - name: plugin/foobar
1083 template:
1084 - name: plugin-triggering
1085 jobprefix: plugin-foobar
1086 - name: plugin-extras
1087 jobprefix: plugin-foobar
1088 check:
1089 - foobar-extra-special-job
1090
Steven Dake21ef9ad2014-08-25 23:08:14 -07001091Individual jobs may optionally be added to pipelines (e.g. check,
Atsushi SAKAI5d7e93b2015-07-28 22:15:48 +09001092gate, et cetera) for a project, in addition to those provided by
Steven Dake21ef9ad2014-08-25 23:08:14 -07001093templates.
1094
James E. Blair3e98c022013-12-16 15:25:38 -08001095The order of the jobs listed in the project (which only affects the
1096order of jobs listed on the report) will be the jobs from each
1097template in the order listed, followed by any jobs individually listed
1098for the project.
1099
1100Note that if multiple templates are used for a project and one
1101template specifies a job that is also specified in another template,
James E. Blair12a92b12014-03-26 11:54:53 -07001102or specified in the project itself, the configuration defined by
1103either the last template or the project itself will take priority.
James E. Blair3e98c022013-12-16 15:25:38 -08001104
James E. Blaircdd00072012-06-08 19:17:28 -07001105logging.conf
1106~~~~~~~~~~~~
1107This file is optional. If provided, it should be a standard
1108:mod:`logging.config` module configuration file. If not present, Zuul will
1109output all log messages of DEBUG level or higher to the console.
1110
1111Starting Zuul
1112-------------
1113
1114To start Zuul, run **zuul-server**::
1115
Antoine Mussob3aa8282013-04-19 15:16:59 +02001116 usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version]
James E. Blaircdd00072012-06-08 19:17:28 -07001117
1118 Project gating system.
1119
1120 optional arguments:
1121 -h, --help show this help message and exit
1122 -c CONFIG specify the config file
Antoine Mussob3aa8282013-04-19 15:16:59 +02001123 -l LAYOUT specify the layout file
James E. Blaircdd00072012-06-08 19:17:28 -07001124 -d do not run as a daemon
Antoine Mussob3aa8282013-04-19 15:16:59 +02001125 -t validate layout file syntax
1126 --version show zuul version
James E. Blaircdd00072012-06-08 19:17:28 -07001127
1128You may want to use the ``-d`` argument while you are initially setting
1129up Zuul so you can detect any configuration errors quickly. Under
1130normal operation, omit ``-d`` and let Zuul run as a daemon.
1131
1132If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will
1133stop executing new jobs, wait until all executing jobs are finished,
1134reload its configuration, and resume. Any values in any of the
1135configuration files may be changed, except the location of Zuul's PID
1136file (a change to that will be ignored until Zuul is restarted).
Clark Boylanf231fa22013-02-08 12:28:53 -08001137
1138If you send a SIGUSR1 to the zuul-server process, Zuul will stop
1139executing new jobs, wait until all executing jobs are finished,
1140then exit. While waiting to exit Zuul will queue Gerrit events and
1141save these events prior to exiting. When Zuul starts again it will
1142read these saved events and act on them.
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001143
Michael Prokop526926a2013-10-24 16:16:57 +02001144If you need to abort Zuul and intend to manually requeue changes for
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001145jobs which were running in its pipelines, prior to terminating you can
1146use the zuul-changes.py tool script to simplify the process. For
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001147example, this would give you a list of zuul-enqueue commands to requeue
1148changes for the gate and check pipelines respectively::
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001149
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001150 ./tools/zuul-changes.py http://zuul.openstack.org/ gate
1151 ./tools/zuul-changes.py http://zuul.openstack.org/ check
Clark Boylanfba9b242013-08-20 10:11:17 -07001152
Antoine Musso29eab012014-10-28 21:35:22 +01001153If you send a SIGUSR2 to the zuul-server process, or the forked process
1154that runs the Gearman daemon, Zuul will dump a stack trace for each
1155running thread into its debug log. It is written under the log bucket
1156``zuul.stack_dump``. This is useful for tracking down deadlock or
1157otherwise slow threads.
Antoine Mussod0f06262014-06-04 09:54:24 +02001158
1159When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python
1160Profiler) is available, additional functions' and threads' stats are
1161emitted as well. The first SIGUSR2 will enable yappi, on the second
1162SIGUSR2 it dumps the information collected, resets all yappi state and
1163stops profiling. This is to minimize the impact of yappi on a running
1164system.