blob: be9570c35188b857534d9c94e34c03c24280e5f5 [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
Paul Belanger9208dc12016-06-08 16:43:55 -040052**check_job_registration**
53 Check to see if job is registered with Gearman or not. When True
54 a build result of NOT_REGISTERED will be return if job is not found.
55 ``check_job_registration=True``
56
James E. Blair77cc7b82013-07-15 13:22:37 -070057gearman_server
58""""""""""""""
59
60**start**
61 Whether to start the internal Gearman server (default: False).
62 ``start=true``
63
James E. Blair0ac452e2015-07-22 09:05:16 -070064**listen_address**
65 IP address or domain name on which to listen (default: all addresses).
66 ``listen_address=127.0.0.1``
67
James E. Blair77cc7b82013-07-15 13:22:37 -070068**log_config**
69 Path to log config file for internal Gearman server.
70 ``log_config=/etc/zuul/gearman-logging.yaml``
71
Clark Boylan9b670902012-09-28 13:47:56 -070072zuul
73""""
74
Antoine Musso9adc6d42014-11-14 15:37:48 +010075.. _layout_config:
76
Clark Boylan9b670902012-09-28 13:47:56 -070077**layout_config**
James E. Blair4076e2b2014-01-28 12:42:20 -080078 Path to layout config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070079 ``layout_config=/etc/zuul/layout.yaml``
80
81**log_config**
James E. Blaira4430132014-02-17 08:32:07 -080082 Path to log config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070083 ``log_config=/etc/zuul/logging.yaml``
84
85**pidfile**
James E. Blaira4430132014-02-17 08:32:07 -080086 Path to PID lock file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070087 ``pidfile=/var/run/zuul/zuul.pid``
88
89**state_dir**
James E. Blair4076e2b2014-01-28 12:42:20 -080090 Path to directory that Zuul should save state to. Used by all Zuul
91 commands.
Clark Boylan9b670902012-09-28 13:47:56 -070092 ``state_dir=/var/lib/zuul``
93
James E. Blair4076e2b2014-01-28 12:42:20 -080094**report_times**
95 Boolean value (``true`` or ``false``) that determines if Zuul should
96 include elapsed times for each job in the textual report. Used by
97 zuul-server only.
98 ``report_times=true``
99
100**status_url**
101 URL that will be posted in Zuul comments made to Gerrit changes when
102 starting jobs for a change. Used by zuul-server only.
103 ``status_url=https://zuul.example.com/status``
104
Clark Boylane0b4bdb2014-06-03 17:01:25 -0700105**status_expiry**
106 Zuul will cache the status.json file for this many seconds. This is an
107 optional value and ``1`` is used by default.
108 ``status_expiry=1``
109
James E. Blair4076e2b2014-01-28 12:42:20 -0800110**url_pattern**
111 If you are storing build logs external to the system that originally
112 ran jobs and wish to link to those logs when Zuul makes comments on
113 Gerrit changes for completed jobs this setting configures what the
114 URLs for those links should be. Used by zuul-server only.
115 ``http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}``
116
117**job_name_in_report**
118 Boolean value (``true`` or ``false``) that indicates whether the
119 job name should be included in the report (normally only the URL
120 is included). Defaults to ``false``. Used by zuul-server only.
121 ``job_name_in_report=true``
122
123merger
124""""""
125
Clark Boylan9b670902012-09-28 13:47:56 -0700126**git_dir**
127 Directory that Zuul should clone local git repositories to.
128 ``git_dir=/var/lib/zuul/git``
129
Paul Belangerb67aba12013-05-13 19:22:14 -0400130**git_user_email**
131 Optional: Value to pass to `git config user.email`.
132 ``git_user_email=zuul@example.com``
133
134**git_user_name**
135 Optional: Value to pass to `git config user.name`.
136 ``git_user_name=zuul``
137
Arx Cruzb1b010d2013-10-28 19:49:59 -0200138**zuul_url**
James E. Blair4076e2b2014-01-28 12:42:20 -0800139 URL of this merger's git repos, accessible to test workers. Usually
140 "http://zuul.example.com/p" or "http://zuul-merger01.example.com/p"
141 depending on whether the merger is co-located with the Zuul server.
Arx Cruzb1b010d2013-10-28 19:49:59 -0200142
James E. Blaira4430132014-02-17 08:32:07 -0800143**log_config**
144 Path to log config file for the merger process.
145 ``log_config=/etc/zuul/logging.yaml``
146
147**pidfile**
148 Path to PID lock file for the merger process.
149 ``pidfile=/var/run/zuul-merger/merger.pid``
150
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100151.. _swift:
152
153swift
154"""""
155
156To send (optional) swift upload instructions this section must be
Antoine Musso62fa2d42014-06-04 22:55:23 +0200157present. Multiple destinations can be defined in the :ref:`jobs` section
158of the layout.
159
160If you are sending the temp-url-key or fetching the x-storage-url, you
161will need the python-swiftclient module installed.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100162
Joshua Heskethc4967502014-05-15 06:39:14 -0700163**X-Account-Meta-Temp-Url-Key** (optional)
164 This is the key used to sign the HMAC message. If you do not set a
165 key Zuul will generate one automatically.
166
167**Send-Temp-Url-Key** (optional)
168 Zuul can send the X-Account-Meta-Temp-Url-Key to swift for you if
169 you have set up the appropriate credentials in ``authurl`` below.
170 This isn't necessary if you know and have set your
171 X-Account-Meta-Temp-Url-Key.
Antoine Musso62fa2d42014-06-04 22:55:23 +0200172 If set, Zuul requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700173 ``default: true``
174
175**X-Storage-Url** (optional)
176 The storage URL is the destination to upload files into. If you do
177 not set this the ``authurl`` credentials are used to fetch the url
Antoine Musso62fa2d42014-06-04 22:55:23 +0200178 from swift and Zuul will requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700179
180**authurl** (optional)
181 The (keystone) Auth URL for swift.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100182 ``For example, https://identity.api.rackspacecloud.com/v2.0/``
Joshua Heskethc4967502014-05-15 06:39:14 -0700183 This is required if you have Send-Temp-Url-Key set to ``True`` or
184 if you have not supplied the X-Storage-Url.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100185
186Any of the `swiftclient connection parameters`_ can also be defined
187here by the same name. Including the os_options by their key name (
188``for example tenant_id``)
189
190.. _swiftclient connection parameters: http://docs.openstack.org/developer/python-swiftclient/swiftclient.html#module-swiftclient.client
191
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100192**region_name** (optional)
193 The region name holding the swift container
194 ``For example, SYD``
195
196Each destination defined by the :ref:`jobs` will have the following
197default values that it may overwrite.
198
199**default_container** (optional)
200 Container name to place the log into
201 ``For example, logs``
202
203**default_expiry** (optional)
204 How long the signed destination should be available for
205 ``default: 7200 (2hrs)``
206
207**default_max_file_size** (optional)
208 The maximum size of an individual file
209 ``default: 104857600 (100MB)``
210
211**default_max_file_count** (optional)
212 The maximum number of separate files to allow
213 ``default: 10``
214
215**default_logserver_prefix**
216 Provide a URL to the CDN or logserver app so that a worker knows
217 what URL to return. The worker should return the logserver_prefix
218 url and the object path.
219 ``For example: http://logs.example.org/server.app?obj=``
220
Joshua Heskethfe485c62015-08-11 23:42:34 +1000221.. _connection:
222
223connection ArbitraryName
224""""""""""""""""""""""""
225
226A connection can be listed with any arbitrary name. The required
227parameters are specified in the :ref:`connections` documentation
228depending on what driver you are using.
229
230.. _layoutyaml:
231
James E. Blaircdd00072012-06-08 19:17:28 -0700232layout.yaml
233~~~~~~~~~~~
234
Clark Boylan00635dc2012-09-19 14:03:08 -0700235This is the main configuration file for Zuul, where all of the pipelines
James E. Blaircdd00072012-06-08 19:17:28 -0700236and projects are defined, what tests should be run, and what actions
Clark Boylan00635dc2012-09-19 14:03:08 -0700237Zuul should perform. There are three sections: pipelines, jobs, and
James E. Blaircdd00072012-06-08 19:17:28 -0700238projects.
239
James E. Blaire5a847f2012-07-10 15:29:14 -0700240.. _includes:
241
242Includes
243""""""""
244
245Custom functions to be used in Zuul's configuration may be provided
246using the ``includes`` directive. It accepts a list of files to
247include, and currently supports one type of inclusion, a python file::
248
249 includes:
250 - python-file: local_functions.py
251
252**python-file**
Antoine Musso9adc6d42014-11-14 15:37:48 +0100253 The path to a python file (either an absolute path or relative to the
254 directory name of :ref:`layout_config <layout_config>`). The
255 file will be loaded and objects that it defines will be placed in a
256 special environment which can be referenced in the Zuul configuration.
257 Currently only the parameter-function attribute of a Job uses this
258 feature.
James E. Blaire5a847f2012-07-10 15:29:14 -0700259
Clark Boylan00635dc2012-09-19 14:03:08 -0700260Pipelines
261"""""""""
James E. Blaircdd00072012-06-08 19:17:28 -0700262
Clark Boylan00635dc2012-09-19 14:03:08 -0700263Zuul can have any number of independent pipelines. Whenever a matching
264Gerrit event is found for a pipeline, that event is added to the
265pipeline, and the jobs specified for that pipeline are run. When all
266jobs specified for the pipeline that were triggered by an event are
267completed, Zuul reports back to Gerrit the results.
James E. Blaircdd00072012-06-08 19:17:28 -0700268
Clark Boylan00635dc2012-09-19 14:03:08 -0700269There are no pre-defined pipelines in Zuul, rather you can define
270whatever pipelines you need in the layout file. This is a very flexible
271system that can accommodate many kinds of workflows.
James E. Blaircdd00072012-06-08 19:17:28 -0700272
Clark Boylan00635dc2012-09-19 14:03:08 -0700273Here is a quick example of a pipeline definition followed by an
James E. Blaircdd00072012-06-08 19:17:28 -0700274explanation of each of the parameters::
275
276 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700277 manager: IndependentPipelineManager
Joshua Heskethfe485c62015-08-11 23:42:34 +1000278 source: my_gerrit
James E. Blaircdd00072012-06-08 19:17:28 -0700279 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000280 my_gerrit:
James E. Blair6c358e72013-07-29 17:06:47 -0700281 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700282 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000283 my_gerrit:
284 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700285 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000286 my_gerrit
287 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700288
289**name**
290 This is used later in the project definition to indicate what jobs
Clark Boylan00635dc2012-09-19 14:03:08 -0700291 should be run for events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700292
James E. Blair8dbd56a2012-12-22 10:55:10 -0800293**description**
294 This is an optional field that may be used to provide a textual
295 description of the pipeline.
296
James E. Blairc0dedf82014-08-06 09:37:52 -0700297**source**
Joshua Heskethfe485c62015-08-11 23:42:34 +1000298 A required field that specifies a connection that provides access to
299 the change objects that this pipeline operates on. The name of the
300 connection as per the zuul.conf should be specified. The driver used
301 for the connection named will be the source. Currently only ``gerrit``
302 drivers are supported.
James E. Blairc0dedf82014-08-06 09:37:52 -0700303
James E. Blair56370192013-01-14 15:47:28 -0800304**success-message**
305 An optional field that supplies the introductory text in message
306 reported back to Gerrit when all the voting builds are successful.
307 Defaults to "Build successful."
308
309**failure-message**
310 An optional field that supplies the introductory text in message
311 reported back to Gerrit when at least one voting build fails.
312 Defaults to "Build failed."
313
Joshua Heskethb7179772014-01-30 23:30:46 +1100314**merge-failure-message**
315 An optional field that supplies the introductory text in message
316 reported back to Gerrit when a change fails to merge with the
317 current state of the repository.
318 Defaults to "Merge failed."
319
Joshua Hesketh3979e3e2014-03-04 11:21:10 +1100320**footer-message**
321 An optional field to supply additional information after test results.
322 Useful for adding information about the CI system such as debugging
323 and contact details.
324
James E. Blaircdd00072012-06-08 19:17:28 -0700325**manager**
Clark Boylan00635dc2012-09-19 14:03:08 -0700326 There are currently two schemes for managing pipelines:
James E. Blaircdd00072012-06-08 19:17:28 -0700327
Clark Boylan00635dc2012-09-19 14:03:08 -0700328 *IndependentPipelineManager*
329 Every event in this pipeline should be treated as independent of
330 other events in the pipeline. This is appropriate when the order of
331 events in the pipeline doesn't matter because the results of the
332 actions this pipeline performs can not affect other events in the
333 pipeline. For example, when a change is first uploaded for review,
James E. Blaircdd00072012-06-08 19:17:28 -0700334 you may want to run tests on that change to provide early feedback
335 to reviewers. At the end of the tests, the change is not going to
336 be merged, so it is safe to run these tests in parallel without
Clark Boylan00635dc2012-09-19 14:03:08 -0700337 regard to any other changes in the pipeline. They are independent.
James E. Blaircdd00072012-06-08 19:17:28 -0700338
Clark Boylan00635dc2012-09-19 14:03:08 -0700339 Another type of pipeline that is independent is a post-merge
340 pipeline. In that case, the changes have already merged, so the
341 results can not affect any other events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700342
Clark Boylan00635dc2012-09-19 14:03:08 -0700343 *DependentPipelineManager*
344 The dependent pipeline manager is designed for gating. It ensures
James E. Blaircdd00072012-06-08 19:17:28 -0700345 that every change is tested exactly as it is going to be merged
346 into the repository. An ideal gating system would test one change
347 at a time, applied to the tip of the repository, and only if that
348 change passed tests would it be merged. Then the next change in
349 line would be tested the same way. In order to achieve parallel
Clark Boylan00635dc2012-09-19 14:03:08 -0700350 testing of changes, the dependent pipeline manager performs
James E. Blaircdd00072012-06-08 19:17:28 -0700351 speculative execution on changes. It orders changes based on
Clark Boylan00635dc2012-09-19 14:03:08 -0700352 their entry into the pipeline. It begins testing all changes in
353 parallel, assuming that each change ahead in the pipeline will pass
James E. Blaircdd00072012-06-08 19:17:28 -0700354 its tests. If they all succeed, all the changes can be tested and
Clark Boylan00635dc2012-09-19 14:03:08 -0700355 merged in parallel. If a change near the front of the pipeline
356 fails its tests, each change behind it ignores whatever tests have
357 been completed and are tested again without the change in front.
358 This way gate tests may run in parallel but still be tested
359 correctly, exactly as they will appear in the repository when
360 merged.
James E. Blaircdd00072012-06-08 19:17:28 -0700361
Clark Boylan00635dc2012-09-19 14:03:08 -0700362 One important characteristic of the DependentPipelineManager is that
James E. Blaircdd00072012-06-08 19:17:28 -0700363 it analyzes the jobs that are triggered by different projects, and
364 if those projects have jobs in common, it treats those projects as
365 related, and they share a single virtual queue of changes. Thus,
366 if there is a job that performs integration testing on two
367 projects, those two projects will automatically share a virtual
368 change queue. If a third project does not invoke that job, it
Clark Boylan00635dc2012-09-19 14:03:08 -0700369 will be part of a separate virtual change queue, and changes to
370 it will not depend on changes to the first two jobs.
James E. Blaircdd00072012-06-08 19:17:28 -0700371
372 For more detail on the theory and operation of Zuul's
Clark Boylan00635dc2012-09-19 14:03:08 -0700373 DependentPipelineManager, see: :doc:`gating`.
James E. Blaircdd00072012-06-08 19:17:28 -0700374
375**trigger**
James E. Blairc494d542014-08-06 09:23:52 -0700376 At least one trigger source must be supplied for each pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700377 Triggers are not exclusive -- matching events may be placed in
James E. Blair6c358e72013-07-29 17:06:47 -0700378 multiple pipelines, and they will behave independently in each of
Joshua Heskethfe485c62015-08-11 23:42:34 +1000379 the pipelines they match.
James E. Blaircdd00072012-06-08 19:17:28 -0700380
Joshua Heskethfe485c62015-08-11 23:42:34 +1000381 Triggers are loaded from their connection name. The driver type of
382 the connection will dictate which options are available.
383 See :doc:`triggers`.
James E. Blairc494d542014-08-06 09:23:52 -0700384
James E. Blair11041d22014-05-02 14:49:53 -0700385**require**
386 If this section is present, it established pre-requisites for any
387 kind of item entering the Pipeline. Regardless of how the item is
388 to be enqueued (via any trigger or automatic dependency resolution),
389 the conditions specified here must be met or the item will not be
390 enqueued.
391
Antoine Musso27ab0d52014-10-22 14:20:17 +0200392.. _pipeline-require-approval:
393
James E. Blair5bf78a32015-07-30 18:08:24 +0000394 **approval**
James E. Blair11041d22014-05-02 14:49:53 -0700395 This requires that a certain kind of approval be present for the
396 current patchset of the change (the approval could be added by the
397 event in question). It takes several sub-parameters, all of which
398 are optional and are combined together so that there must be an
399 approval matching all specified requirements.
400
401 *username*
James E. Blairb01ec542016-06-16 09:46:49 -0700402 If present, an approval from this username is required. It is
403 treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700404
James E. Blair1fbfceb2014-06-23 14:42:53 -0700405 *email*
James E. Blair11041d22014-05-02 14:49:53 -0700406 If present, an approval with this email address is required. It
James E. Blairb01ec542016-06-16 09:46:49 -0700407 is treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700408
James E. Blair1fbfceb2014-06-23 14:42:53 -0700409 *email-filter* (deprecated)
410 A deprecated alternate spelling of *email*. Only one of *email* or
411 *email_filter* should be used.
412
James E. Blair11041d22014-05-02 14:49:53 -0700413 *older-than*
414 If present, the approval must be older than this amount of time
415 to match. Provide a time interval as a number with a suffix of
416 "w" (weeks), "d" (days), "h" (hours), "m" (minutes), "s"
417 (seconds). Example ``48h`` or ``2d``.
418
419 *newer-than*
420 If present, the approval must be newer than this amount of time
421 to match. Same format as "older-than".
422
423 Any other field is interpreted as a review category and value
424 pair. For example ``verified: 1`` would require that the approval
James E. Blair9c17dbf2014-06-23 14:21:58 -0700425 be for a +1 vote in the "Verified" column. The value may either
426 be a single value or a list: ``verified: [1, 2]`` would match
427 either a +1 or +2 vote.
James E. Blair11041d22014-05-02 14:49:53 -0700428
429 **open**
430 A boolean value (``true`` or ``false``) that indicates whether the change
431 must be open or closed in order to be enqueued.
432
Clark Boylana9702ad2014-05-08 17:17:24 -0700433 **current-patchset**
434 A boolean value (``true`` or ``false``) that indicates whether the change
435 must be the current patchset in order to be enqueued.
436
James E. Blair11041d22014-05-02 14:49:53 -0700437 **status**
438 A string value that corresponds with the status of the change
439 reported by the trigger. For example, when using the Gerrit
440 trigger, status values such as ``NEW`` or ``MERGED`` may be useful.
James E. Blair63bb0ef2013-07-29 17:14:51 -0700441
Joshua Hesketh66c8e522014-06-26 15:30:08 +1000442**reject**
443 If this section is present, it establishes pre-requisites that can
444 block an item from being enqueued. It can be considered a negative
445 version of **require**.
446
447 **approval**
448 This takes a list of approvals. If an approval matches the provided
449 criteria the change can not be entered into the pipeline. It follows
450 the same syntax as the :ref:`"require approval" pipeline above
451 <pipeline-require-approval>`.
452
453 Example to reject a change with any negative vote::
454
455 reject:
456 approval:
457 - code-review: [-1, -2]
458
James E. Blair2fa50962013-01-30 21:50:41 -0800459**dequeue-on-new-patchset**
460 Normally, if a new patchset is uploaded to a change that is in a
461 pipeline, the existing entry in the pipeline will be removed (with
462 jobs canceled and any dependent changes that can no longer merge as
463 well. To suppress this behavior (and allow jobs to continue
464 running), set this to ``false``. Default: ``true``.
465
James E. Blair17dd6772015-02-09 14:45:18 -0800466**ignore-dependencies**
467 In any kind of pipeline (dependent or independent), Zuul will
468 attempt to enqueue all dependencies ahead of the current change so
469 that they are tested together (independent pipelines report the
470 results of each change regardless of the results of changes ahead).
471 To ignore dependencies completely in an independent pipeline, set
472 this to ``true``. This option is ignored by dependent pipelines.
473 The default is: ``false``.
474
James E. Blaircdd00072012-06-08 19:17:28 -0700475**success**
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000476 Describes where Zuul should report to if all the jobs complete
477 successfully.
James E. Blaircdd00072012-06-08 19:17:28 -0700478 This section is optional; if it is omitted, Zuul will run jobs and
479 do nothing on success; it will not even report a message to Gerrit.
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000480 If the section is present, the listed reporter plugins will be
481 asked to report on the jobs.
Joshua Heskethfe485c62015-08-11 23:42:34 +1000482 The reporters are listed by their connection name. The options
483 available depend on the driver for the supplied connection.
484 See :doc:`reporters` for more details.
James E. Blaircdd00072012-06-08 19:17:28 -0700485
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400486**failure**
James E. Blaircdd00072012-06-08 19:17:28 -0700487 Uses the same syntax as **success**, but describes what Zuul should
488 do if at least one job fails.
James E. Blairdc253862012-06-13 17:12:42 -0700489
Joshua Heskethb7179772014-01-30 23:30:46 +1100490**merge-failure**
491 Uses the same syntax as **success**, but describes what Zuul should
492 do if it is unable to merge in the patchset. If no merge-failure
493 reporters are listed then the ``failure`` reporters will be used to
494 notify of unsuccessful merges.
495
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400496**start**
James E. Blairdc253862012-06-13 17:12:42 -0700497 Uses the same syntax as **success**, but describes what Zuul should
Clark Boylan00635dc2012-09-19 14:03:08 -0700498 do when a change is added to the pipeline manager. This can be used,
James E. Blairdc253862012-06-13 17:12:42 -0700499 for example, to reset the value of the Verified review category.
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400500
Joshua Hesketh89e829d2015-02-10 16:29:45 +1100501**disabled**
502 Uses the same syntax as **success**, but describes what Zuul should
503 do when a pipeline is disabled.
504 See ``disable-after-consecutive-failures``.
505
506**disable-after-consecutive-failures**
507 If set, a pipeline can enter a ''disabled'' state if too many changes
508 in a row fail. When this value is exceeded the pipeline will stop
509 reporting to any of the ``success``, ``failure`` or ``merge-failure``
510 reporters and instead only report to the ``disabled`` reporters.
511 (No ``start`` reports are made when a pipeline is disabled).
512
James E. Blair64ed6f22013-07-10 14:07:23 -0700513**precedence**
514 Indicates how the build scheduler should prioritize jobs for
515 different pipelines. Each pipeline may have one precedence, jobs
516 for pipelines with a higher precedence will be run before ones with
517 lower. The value should be one of ``high``, ``normal``, or ``low``.
518 Default: ``normal``.
519
Clark Boylanc2d19e42014-01-23 14:08:58 -0800520**window**
521 DependentPipelineManagers only. Zuul can rate limit
522 DependentPipelineManagers in a manner similar to TCP flow control.
523 Jobs are only started for changes in the queue if they sit in the
524 actionable window for the pipeline. The initial length of this window
525 is configurable with this value. The value given should be a positive
526 integer value. A value of ``0`` disables rate limiting on the
527 DependentPipelineManager.
528 Default: ``20``.
529
530**window-floor**
531 DependentPipelineManagers only. This is the minimum value for the
532 window described above. Should be a positive non zero integer value.
533 Default: ``3``.
534
535**window-increase-type**
536 DependentPipelineManagers only. This value describes how the window
537 should grow when changes are successfully merged by zuul. A value of
538 ``linear`` indicates that ``window-increase-factor`` should be added
539 to the previous window value. A value of ``exponential`` indicates
540 that ``window-increase-factor`` should be multiplied against the
541 previous window value and the result will become the window size.
542 Default: ``linear``.
543
544**window-increase-factor**
Clint Adams041ae512015-06-16 20:02:29 -0400545 DependentPipelineManagers only. The value to be added or multiplied
Clark Boylanc2d19e42014-01-23 14:08:58 -0800546 against the previous window value to determine the new window after
547 successful change merges.
548 Default: ``1``.
549
550**window-decrease-type**
551 DependentPipelineManagers only. This value describes how the window
552 should shrink when changes are not able to be merged by Zuul. A value
553 of ``linear`` indicates that ``window-decrease-factor`` should be
554 subtracted from the previous window value. A value of ``exponential``
555 indicates that ``window-decrease-factor`` should be divided against
556 the previous window value and the result will become the window size.
557 Default: ``exponential``.
558
559**window-decrease-factor**
560 DependentPipelineManagers only. The value to be subtracted or divided
561 against the previous window value to determine the new window after
562 unsuccessful change merges.
563 Default: ``2``.
564
Clark Boylan00635dc2012-09-19 14:03:08 -0700565Some example pipeline configurations are included in the sample layout
566file. The first is called a *check* pipeline::
James E. Blaircdd00072012-06-08 19:17:28 -0700567
568 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700569 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700570 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000571 my_gerrit:
572 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700573 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000574 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000575 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700576 failure:
Thomas Bechtolda8c0dbd2015-12-10 07:16:54 +0100577 my_gerrit:
578 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700579
580This will trigger jobs each time a new patchset (or change) is
581uploaded to Gerrit, and report +/-1 values to Gerrit in the
582``verified`` review category. ::
583
584 - name: gate
Clark Boylan00635dc2012-09-19 14:03:08 -0700585 manager: DependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700586 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000587 my_gerrit:
588 - event: comment-added
589 approval:
590 - approved: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700591 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000592 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000593 verified: 2
594 submit: true
James E. Blaircdd00072012-06-08 19:17:28 -0700595 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000596 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000597 verified: -2
James E. Blaircdd00072012-06-08 19:17:28 -0700598
599This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the
600``approved`` review category in Gerrit (a non-standard category).
601Changes will be tested in such a way as to guarantee that they will be
602merged exactly as tested, though that will happen in parallel by
603creating a virtual queue of dependent changes and performing
604speculative execution of jobs. ::
605
606 - name: post
Clark Boylan00635dc2012-09-19 14:03:08 -0700607 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700608 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000609 my_gerrit:
610 - event: ref-updated
611 ref: ^(?!refs/).*$
James E. Blaircdd00072012-06-08 19:17:28 -0700612
613This will trigger jobs whenever a change is merged to a named branch
614(e.g., ``master``). No output will be reported to Gerrit. This is
615useful for side effects such as creating per-commit tarballs. ::
616
617 - name: silent
Clark Boylan00635dc2012-09-19 14:03:08 -0700618 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700619 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000620 my_gerrit:
621 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700622
623This also triggers jobs when changes are uploaded to Gerrit, but no
624results are reported to Gerrit. This is useful for jobs that are in
Antoine Mussoce333842012-10-16 14:42:35 +0200625development and not yet ready to be presented to developers. ::
626
627 pipelines:
628 - name: post-merge
629 manager: IndependentPipelineManager
630 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000631 my_gerrit:
632 - event: change-merged
Antoine Mussoce333842012-10-16 14:42:35 +0200633 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000634 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000635 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200636 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000637 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000638 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200639
640The ``change-merged`` events happen when a change has been merged in the git
641repository. The change is thus closed and Gerrit will not accept modifications
642to the review scoring such as ``code-review`` or ``verified``. By using the
643``force-message: True`` parameter, Zuul will pass ``--force-message`` to the
644``gerrit review`` command, thus making sure the message is actually
645sent back to Gerrit regardless of approval scores.
646That kind of pipeline is nice to run regression or performance tests.
647
648.. note::
649 The ``change-merged`` event does not include the commit sha1 which can be
650 hazardous, it would let you report back to Gerrit though. If you were to
Michael Prokop526926a2013-10-24 16:16:57 +0200651 build a tarball for a specific commit, you should consider instead using
Łukasz Jernaś048acb42014-03-02 18:49:41 +0100652 the ``ref-updated`` event which does include the commit sha1 (but lacks the
Antoine Mussoce333842012-10-16 14:42:35 +0200653 Gerrit change number).
James E. Blaircdd00072012-06-08 19:17:28 -0700654
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100655
656.. _jobs:
657
James E. Blaircdd00072012-06-08 19:17:28 -0700658Jobs
659""""
660
661The jobs section is optional, and can be used to set attributes of
662jobs that are independent of their association with a project. For
663example, if a job should return a customized message on failure, that
664may be specified here. Otherwise, Zuul does not need to be told about
665each job as it builds a list from the project specification.
666
667**name**
668 The name of the job. This field is treated as a regular expression
669 and will be applied to each job that matches.
670
James E. Blairc8a1e052014-02-25 09:29:26 -0800671**queue-name (optional)**
672 Zuul will automatically combine projects that share a job into
673 shared change queues for dependent pipeline managers. In order to
674 report statistics about these queues, it is convenient for them to
675 have names. Zuul can automatically name change queues, however
676 these can grow quite long and are prone to changing as projects in
677 the queue change. If you assign a queue-name to a job, Zuul will
678 use that as the name for the shared change queue that contains that
679 job instead of the automatically generated one. It is an error for
680 a shared change queue to have more than one job with a queue-name if
681 they are not the same.
682
James E. Blaire5a847f2012-07-10 15:29:14 -0700683**failure-message (optional)**
684 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700685
James E. Blaire5a847f2012-07-10 15:29:14 -0700686**success-message (optional)**
687 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700688
James E. Blair6aea36d2012-12-17 13:03:24 -0800689**failure-pattern (optional)**
690 The URL that should be reported to Gerrit if the job fails.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700691 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800692 zuul.conf. May be supplied as a string pattern with substitutions
693 as described in url_pattern in :ref:`zuulconf`.
694
695**success-pattern (optional)**
696 The URL that should be reported to Gerrit if the job succeeds.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700697 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800698 zuul.conf. May be supplied as a string pattern with substitutions
699 as described in url_pattern in :ref:`zuulconf`.
700
James E. Blair222d4982012-07-16 09:31:19 -0700701**hold-following-changes (optional)**
702 This is a boolean that indicates that changes that follow this
Clark Boylan00635dc2012-09-19 14:03:08 -0700703 change in a dependent change pipeline should wait until this job
James E. Blair222d4982012-07-16 09:31:19 -0700704 succeeds before launching. If this is applied to a very short job
705 that can predict whether longer jobs will fail early, this can be
706 used to reduce the number of jobs that Zuul will launch and
707 ultimately have to cancel. In that case, a small amount of
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400708 parallelization of jobs is traded for more efficient use of testing
James E. Blair222d4982012-07-16 09:31:19 -0700709 resources. On the other hand, to apply this to a long running job
710 would largely defeat the parallelization of dependent change testing
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400711 that is the main feature of Zuul. Default: ``false``.
James E. Blair222d4982012-07-16 09:31:19 -0700712
James E. Blairaf17a972016-02-03 15:07:18 -0800713**mutex (optional)**
714 This is a string that names a mutex that should be observed by this
715 job. Only one build of any job that references the same named mutex
716 will be enqueued at a time. This applies across all pipelines.
717
James E. Blaire5a847f2012-07-10 15:29:14 -0700718**branch (optional)**
James E. Blaircdd00072012-06-08 19:17:28 -0700719 This job should only be run on matching branches. This field is
720 treated as a regular expression and multiple branches may be
721 listed.
722
James E. Blair70c71582013-03-06 08:50:50 -0800723**files (optional)**
724 This job should only be run if at least one of the files involved in
725 the change (added, deleted, or modified) matches at least one of the
726 file patterns listed here. This field is treated as a regular
727 expression and multiple expressions may be listed.
728
Maru Newby3fe5f852015-01-13 04:22:14 +0000729**skip-if (optional)**
730
731 This job should not be run if all the patterns specified by the
732 optional fields listed below match on their targets. When multiple
733 sets of parameters are provided, this job will be skipped if any set
734 matches. For example: ::
735
736 jobs:
737 - name: check-tempest-dsvm-neutron
738 skip-if:
739 - project: ^openstack/neutron$
740 branch: ^stable/juno$
741 all-files-match-any:
742 - ^neutron/tests/.*$
743 - ^tools/.*$
744 - all-files-match-any:
745 - ^doc/.*$
746 - ^.*\.rst$
747
748 With this configuration, the job would be skipped for a neutron
749 patchset for the stable/juno branch provided that every file in the
750 change matched at least one of the specified file regexes. The job
751 will also be skipped for any patchset that modified only the doc
752 tree or rst files.
753
754 *project* (optional)
755 The regular expression to match against the project of the change.
756
757 *branch* (optional)
758 The regular expression to match against the branch or ref of the
759 change.
760
761 *all-files-match-any* (optional)
762 A list of regular expressions intended to match the files involved
763 in the change. This parameter will be considered matching a
764 change only if all files in a change match at least one of these
765 expressions.
766
767 The pattern for '/COMMIT_MSG' is always matched on and does not
768 have to be included.
769
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400770**voting (optional)**
771 Boolean value (``true`` or ``false``) that indicates whatever
772 a job is voting or not. Default: ``true``.
773
James E. Blair456f2fb2016-02-09 09:29:33 -0800774**tags (optional)**
775 A list of arbitrary strings which will be associated with the job.
776 Can be used by the parameter-function to alter behavior based on
777 their presence on a job. If the job name is a regular expression,
778 tags will accumulate on jobs that match.
779
James E. Blaire5a847f2012-07-10 15:29:14 -0700780**parameter-function (optional)**
781 Specifies a function that should be applied to the parameters before
782 the job is launched. The function should be defined in a python file
783 included with the :ref:`includes` directive. The function
784 should have the following signature:
785
James E. Blaird0470972013-07-29 10:05:43 -0700786 .. function:: parameters(item, job, parameters)
James E. Blaire5a847f2012-07-10 15:29:14 -0700787
788 Manipulate the parameters passed to a job before a build is
789 launched. The ``parameters`` dictionary will already contain the
790 standard Zuul job parameters, and is expected to be modified
791 in-place.
792
James E. Blaird78576a2013-07-09 10:39:17 -0700793 :param item: the current queue item
794 :type item: zuul.model.QueueItem
James E. Blaird0470972013-07-29 10:05:43 -0700795 :param job: the job about to be run
796 :type job: zuul.model.Job
James E. Blaire5a847f2012-07-10 15:29:14 -0700797 :param parameters: parameters to be passed to the job
798 :type parameters: dict
799
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700800 If the parameter **ZUUL_NODE** is set by this function, then it will
801 be used to specify on what node (or class of node) the job should be
802 run.
803
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100804**swift**
805 If :ref:`swift` is configured then each job can define a destination
806 container for the builder to place logs and/or assets into. Multiple
807 containers can be listed for each job by providing a unique ``name``.
808
809 *name*
810 Set an identifying name for the container. This is used in the
811 parameter key sent to the builder. For example if it ``logs`` then
812 one of the parameters sent will be ``SWIFT_logs_CONTAINER``
813 (case-sensitive).
814
815 Each of the defaults defined in :ref:`swift` can be overwritten as:
816
817 *container* (optional)
818 Container name to place the log into
819 ``For example, logs``
820
821 *expiry* (optional)
822 How long the signed destination should be available for
823
James E. Blaird6500232014-06-23 15:05:48 -0700824 *max-file-size** (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100825 The maximum size of an individual file
826
James E. Blaird6500232014-06-23 15:05:48 -0700827 *max_file_size** (optional, deprecated)
828 A deprecated alternate spelling of *max-file-size*.
829
830 *max-file-count* (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100831 The maximum number of separate files to allow
832
James E. Blaird6500232014-06-23 15:05:48 -0700833 *max_file_count* (optional, deprecated)
834 A deprecated alternate spelling of *max-file-count*.
835
836 *logserver-prefix*
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100837 Provide a URL to the CDN or logserver app so that a worker knows
838 what URL to return.
839 ``For example: http://logs.example.org/server.app?obj=``
James E. Blaird6500232014-06-23 15:05:48 -0700840 The worker should return the logserver-prefix url and the object
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100841 path as the URL in the results data packet.
842
James E. Blaird6500232014-06-23 15:05:48 -0700843 *logserver_prefix* (deprecated)
844 A deprecated alternate spelling of *logserver-prefix*.
845
James E. Blaircdd00072012-06-08 19:17:28 -0700846Here is an example of setting the failure message for jobs that check
847whether a change merges cleanly::
848
849 - name: ^.*-merge$
Jeremy Stanley1c2c3c22015-06-15 21:23:19 +0000850 failure-message: This change or one of its cross-repo dependencies
851 was unable to be automatically merged with the current state of
852 its repository. Please rebase the change and upload a new
853 patchset.
James E. Blaircdd00072012-06-08 19:17:28 -0700854
855Projects
856""""""""
857
Clark Boylan00635dc2012-09-19 14:03:08 -0700858The projects section indicates what jobs should be run in each pipeline
James E. Blaircdd00072012-06-08 19:17:28 -0700859for events associated with each project. It contains a list of
860projects. Here is an example::
861
862 - name: example/project
863 check:
864 - project-merge:
865 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700866 - project-pep8
867 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700868 gate:
869 - project-merge:
870 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700871 - project-pep8
872 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700873 post:
874 - project-publish
875
876**name**
877 The name of the project (as known by Gerrit).
878
James E. Blair19deff22013-08-25 13:17:35 -0700879**merge-mode (optional)**
880 An optional value that indicates what strategy should be used to
881 merge changes to this project. Supported values are:
882
883 ** merge-resolve **
884 Equivalent to 'git merge -s resolve'. This corresponds closely to
885 what Gerrit performs (using JGit) for a project if the "Merge if
886 necessary" merge mode is selected and "Automatically resolve
887 conflicts" is checked. This is the default.
888
889 ** merge **
890 Equivalent to 'git merge'.
891
892 ** cherry-pick **
893 Equivalent to 'git cherry-pick'.
894
Clark Boylan00635dc2012-09-19 14:03:08 -0700895This is followed by a section for each of the pipelines defined above.
896Pipelines may be omitted if no jobs should run for this project in a
897given pipeline. Within the pipeline section, the jobs that should be
James E. Blaircdd00072012-06-08 19:17:28 -0700898executed are listed. If a job is entered as a dictionary key, then
899jobs contained within that key are only executed if the key job
900succeeds. In the above example, project-unittest, project-pep8, and
901project-pyflakes are only executed if project-merge succeeds. This
902can help avoid running unnecessary jobs.
903
James E. Blair18c64442014-03-18 10:14:45 -0700904The special job named ``noop`` is internal to Zuul and will always
905return ``SUCCESS`` immediately. This can be useful if you require
906that all changes be processed by a pipeline but a project has no jobs
907that can be run on it.
908
Andreas Jaegerbcfbf932014-09-29 20:21:44 +0200909.. 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 -0700910
Antoine Musso80edd5a2013-02-13 15:37:53 +0100911Project Templates
912"""""""""""""""""
913
Michael Prokop526926a2013-10-24 16:16:57 +0200914Whenever you have lot of similar projects (such as plugins for a project) you
Antoine Musso80edd5a2013-02-13 15:37:53 +0100915will most probably want to use the same pipeline configurations. The
916project templates let you define pipelines and job name templates to trigger.
917One can then just apply the template on its project which make it easier to
Michael Prokop526926a2013-10-24 16:16:57 +0200918update several similar projects. As an example::
Antoine Musso80edd5a2013-02-13 15:37:53 +0100919
920 project-templates:
921 # Name of the template
922 - name: plugin-triggering
923 # Definition of pipelines just like for a `project`
924 check:
925 - '{jobprefix}-merge':
926 - '{jobprefix}-pep8'
927 - '{jobprefix}-pyflakes'
928 gate:
929 - '{jobprefix}-merge':
930 - '{jobprefix}-unittest'
931 - '{jobprefix}-pep8'
932 - '{jobprefix}-pyflakes'
933
934In your projects definition, you will then apply the template using the template
935key::
936
937 projects:
938 - name: plugin/foobar
939 template:
940 - name: plugin-triggering
941 jobprefix: plugin-foobar
942
James E. Blairaea6cf62013-12-16 15:38:12 -0800943You can pass several parameters to a template. A ``parameter`` value
944will be used for expansion of ``{parameter}`` in the template
945strings. The parameter ``name`` will be automatically provided and
946will contain the short name of the project, that is the portion of the
947project name after the last ``/`` character.
James E. Blaircdd00072012-06-08 19:17:28 -0700948
James E. Blair3e98c022013-12-16 15:25:38 -0800949Multiple templates can be combined in a project, and the jobs from all
950of those templates will be added to the project. Individual jobs may
951also be added::
952
953 projects:
954 - name: plugin/foobar
955 template:
956 - name: plugin-triggering
957 jobprefix: plugin-foobar
958 - name: plugin-extras
959 jobprefix: plugin-foobar
960 check:
961 - foobar-extra-special-job
962
Steven Dake21ef9ad2014-08-25 23:08:14 -0700963Individual jobs may optionally be added to pipelines (e.g. check,
Atsushi SAKAI5d7e93b2015-07-28 22:15:48 +0900964gate, et cetera) for a project, in addition to those provided by
Steven Dake21ef9ad2014-08-25 23:08:14 -0700965templates.
966
James E. Blair3e98c022013-12-16 15:25:38 -0800967The order of the jobs listed in the project (which only affects the
968order of jobs listed on the report) will be the jobs from each
969template in the order listed, followed by any jobs individually listed
970for the project.
971
972Note that if multiple templates are used for a project and one
973template specifies a job that is also specified in another template,
James E. Blair12a92b12014-03-26 11:54:53 -0700974or specified in the project itself, the configuration defined by
975either the last template or the project itself will take priority.
James E. Blair3e98c022013-12-16 15:25:38 -0800976
James E. Blaircdd00072012-06-08 19:17:28 -0700977logging.conf
978~~~~~~~~~~~~
979This file is optional. If provided, it should be a standard
980:mod:`logging.config` module configuration file. If not present, Zuul will
981output all log messages of DEBUG level or higher to the console.
982
983Starting Zuul
984-------------
985
986To start Zuul, run **zuul-server**::
987
Antoine Mussob3aa8282013-04-19 15:16:59 +0200988 usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version]
James E. Blaircdd00072012-06-08 19:17:28 -0700989
990 Project gating system.
991
992 optional arguments:
993 -h, --help show this help message and exit
994 -c CONFIG specify the config file
Antoine Mussob3aa8282013-04-19 15:16:59 +0200995 -l LAYOUT specify the layout file
James E. Blaircdd00072012-06-08 19:17:28 -0700996 -d do not run as a daemon
Antoine Mussob3aa8282013-04-19 15:16:59 +0200997 -t validate layout file syntax
998 --version show zuul version
James E. Blaircdd00072012-06-08 19:17:28 -0700999
1000You may want to use the ``-d`` argument while you are initially setting
1001up Zuul so you can detect any configuration errors quickly. Under
1002normal operation, omit ``-d`` and let Zuul run as a daemon.
1003
1004If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will
1005stop executing new jobs, wait until all executing jobs are finished,
Joshua Heskethc4997152016-02-17 21:04:18 +11001006reload its layout.yaml, and resume. Changes to any connections or
1007the PID file will be ignored until Zuul is restarted.
Clark Boylanf231fa22013-02-08 12:28:53 -08001008
1009If you send a SIGUSR1 to the zuul-server process, Zuul will stop
1010executing new jobs, wait until all executing jobs are finished,
1011then exit. While waiting to exit Zuul will queue Gerrit events and
1012save these events prior to exiting. When Zuul starts again it will
1013read these saved events and act on them.
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001014
Michael Prokop526926a2013-10-24 16:16:57 +02001015If you need to abort Zuul and intend to manually requeue changes for
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001016jobs which were running in its pipelines, prior to terminating you can
1017use the zuul-changes.py tool script to simplify the process. For
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001018example, this would give you a list of zuul-enqueue commands to requeue
1019changes for the gate and check pipelines respectively::
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001020
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001021 ./tools/zuul-changes.py http://zuul.openstack.org/ gate
1022 ./tools/zuul-changes.py http://zuul.openstack.org/ check
Clark Boylanfba9b242013-08-20 10:11:17 -07001023
Antoine Musso29eab012014-10-28 21:35:22 +01001024If you send a SIGUSR2 to the zuul-server process, or the forked process
1025that runs the Gearman daemon, Zuul will dump a stack trace for each
1026running thread into its debug log. It is written under the log bucket
1027``zuul.stack_dump``. This is useful for tracking down deadlock or
1028otherwise slow threads.
Antoine Mussod0f06262014-06-04 09:54:24 +02001029
1030When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python
1031Profiler) is available, additional functions' and threads' stats are
1032emitted as well. The first SIGUSR2 will enable yappi, on the second
1033SIGUSR2 it dumps the information collected, resets all yappi state and
1034stops profiling. This is to minimize the impact of yappi on a running
1035system.