blob: 102beac27382b9711dc3f9ea70e7f7c7be3e9ac7 [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
Thanh Ha266cbb82016-01-24 20:57:59 -050013 other config files. (required)
James E. Blaircdd00072012-06-08 19:17:28 -070014**layout.yaml**
Thanh Ha266cbb82016-01-24 20:57:59 -050015 Project and pipeline configuration -- what Zuul does. (required)
James E. Blaircdd00072012-06-08 19:17:28 -070016**logging.conf**
Thanh Ha266cbb82016-01-24 20:57:59 -050017 Python logging config. (optional)
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
Thanh Ha266cbb82016-01-24 20:57:59 -050044Client connection information for gearman. If using Zuul's builtin gearmand
45server just set **server** to 127.0.0.1.
46
Clark Boylan9b670902012-09-28 13:47:56 -070047**server**
James E. Blair1f4c2bb2013-04-26 08:40:46 -070048 Hostname or IP address of the Gearman server.
Thanh Ha266cbb82016-01-24 20:57:59 -050049 ``server=gearman.example.com`` (required)
Clark Boylan9b670902012-09-28 13:47:56 -070050
James E. Blair1f4c2bb2013-04-26 08:40:46 -070051**port**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010052 Port on which the Gearman server is listening.
Thanh Ha266cbb82016-01-24 20:57:59 -050053 ``port=4730`` (optional)
Clark Boylan9b670902012-09-28 13:47:56 -070054
James E. Blair77cc7b82013-07-15 13:22:37 -070055gearman_server
56""""""""""""""
57
Thanh Ha266cbb82016-01-24 20:57:59 -050058The builtin gearman server. Zuul can fork a gearman process from itself rather
59than connecting to an external one.
60
James E. Blair77cc7b82013-07-15 13:22:37 -070061**start**
62 Whether to start the internal Gearman server (default: False).
63 ``start=true``
64
James E. Blair0ac452e2015-07-22 09:05:16 -070065**listen_address**
66 IP address or domain name on which to listen (default: all addresses).
67 ``listen_address=127.0.0.1``
68
James E. Blair77cc7b82013-07-15 13:22:37 -070069**log_config**
70 Path to log config file for internal Gearman server.
71 ``log_config=/etc/zuul/gearman-logging.yaml``
72
Paul Belanger88ef0ea2015-12-23 11:57:02 -050073webapp
74""""""
75
76**listen_address**
77 IP address or domain name on which to listen (default: 0.0.0.0).
78 ``listen_address=127.0.0.1``
79
80**port**
81 Port on which the webapp is listening (default: 8001).
82 ``port=8008``
83
Clark Boylan9b670902012-09-28 13:47:56 -070084zuul
85""""
86
Thanh Ha266cbb82016-01-24 20:57:59 -050087Zuul's main configuration section. At minimum zuul must be able to find
88layout.yaml to be useful.
89
90.. note:: Must be provided when running zuul-server
91
Antoine Musso9adc6d42014-11-14 15:37:48 +010092.. _layout_config:
93
Clark Boylan9b670902012-09-28 13:47:56 -070094**layout_config**
James E. Blair4076e2b2014-01-28 12:42:20 -080095 Path to layout config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070096 ``layout_config=/etc/zuul/layout.yaml``
97
98**log_config**
James E. Blaira4430132014-02-17 08:32:07 -080099 Path to log config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700100 ``log_config=/etc/zuul/logging.yaml``
101
102**pidfile**
James E. Blaira4430132014-02-17 08:32:07 -0800103 Path to PID lock file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700104 ``pidfile=/var/run/zuul/zuul.pid``
105
106**state_dir**
James E. Blair4076e2b2014-01-28 12:42:20 -0800107 Path to directory that Zuul should save state to. Used by all Zuul
108 commands.
Clark Boylan9b670902012-09-28 13:47:56 -0700109 ``state_dir=/var/lib/zuul``
110
James E. Blair4076e2b2014-01-28 12:42:20 -0800111**report_times**
112 Boolean value (``true`` or ``false``) that determines if Zuul should
113 include elapsed times for each job in the textual report. Used by
114 zuul-server only.
115 ``report_times=true``
116
117**status_url**
118 URL that will be posted in Zuul comments made to Gerrit changes when
119 starting jobs for a change. Used by zuul-server only.
120 ``status_url=https://zuul.example.com/status``
121
Clark Boylane0b4bdb2014-06-03 17:01:25 -0700122**status_expiry**
123 Zuul will cache the status.json file for this many seconds. This is an
124 optional value and ``1`` is used by default.
125 ``status_expiry=1``
126
James E. Blair4076e2b2014-01-28 12:42:20 -0800127**url_pattern**
128 If you are storing build logs external to the system that originally
129 ran jobs and wish to link to those logs when Zuul makes comments on
130 Gerrit changes for completed jobs this setting configures what the
131 URLs for those links should be. Used by zuul-server only.
132 ``http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}``
133
134**job_name_in_report**
135 Boolean value (``true`` or ``false``) that indicates whether the
136 job name should be included in the report (normally only the URL
137 is included). Defaults to ``false``. Used by zuul-server only.
138 ``job_name_in_report=true``
139
140merger
141""""""
142
Thanh Ha266cbb82016-01-24 20:57:59 -0500143The zuul-merger process configuration. Detailed documentation on this process
144can be found on the :doc:`merger` page.
145
146.. note:: Must be provided when running zuul-merger. Both services may share the
147 same configuration (and even host) or otherwise have an individual
148 zuul.conf.
149
Clark Boylan9b670902012-09-28 13:47:56 -0700150**git_dir**
151 Directory that Zuul should clone local git repositories to.
152 ``git_dir=/var/lib/zuul/git``
153
Paul Belangerb67aba12013-05-13 19:22:14 -0400154**git_user_email**
155 Optional: Value to pass to `git config user.email`.
156 ``git_user_email=zuul@example.com``
157
158**git_user_name**
159 Optional: Value to pass to `git config user.name`.
160 ``git_user_name=zuul``
161
Arx Cruzb1b010d2013-10-28 19:49:59 -0200162**zuul_url**
James E. Blair4076e2b2014-01-28 12:42:20 -0800163 URL of this merger's git repos, accessible to test workers. Usually
164 "http://zuul.example.com/p" or "http://zuul-merger01.example.com/p"
165 depending on whether the merger is co-located with the Zuul server.
Arx Cruzb1b010d2013-10-28 19:49:59 -0200166
James E. Blaira4430132014-02-17 08:32:07 -0800167**log_config**
168 Path to log config file for the merger process.
169 ``log_config=/etc/zuul/logging.yaml``
170
171**pidfile**
172 Path to PID lock file for the merger process.
173 ``pidfile=/var/run/zuul-merger/merger.pid``
174
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100175.. _swift:
176
177swift
178"""""
179
180To send (optional) swift upload instructions this section must be
Antoine Musso62fa2d42014-06-04 22:55:23 +0200181present. Multiple destinations can be defined in the :ref:`jobs` section
182of the layout.
183
184If you are sending the temp-url-key or fetching the x-storage-url, you
185will need the python-swiftclient module installed.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100186
Joshua Heskethc4967502014-05-15 06:39:14 -0700187**X-Account-Meta-Temp-Url-Key** (optional)
188 This is the key used to sign the HMAC message. If you do not set a
189 key Zuul will generate one automatically.
190
191**Send-Temp-Url-Key** (optional)
192 Zuul can send the X-Account-Meta-Temp-Url-Key to swift for you if
193 you have set up the appropriate credentials in ``authurl`` below.
194 This isn't necessary if you know and have set your
195 X-Account-Meta-Temp-Url-Key.
Antoine Musso62fa2d42014-06-04 22:55:23 +0200196 If set, Zuul requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700197 ``default: true``
198
199**X-Storage-Url** (optional)
200 The storage URL is the destination to upload files into. If you do
201 not set this the ``authurl`` credentials are used to fetch the url
Antoine Musso62fa2d42014-06-04 22:55:23 +0200202 from swift and Zuul will requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700203
204**authurl** (optional)
205 The (keystone) Auth URL for swift.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100206 ``For example, https://identity.api.rackspacecloud.com/v2.0/``
Joshua Heskethc4967502014-05-15 06:39:14 -0700207 This is required if you have Send-Temp-Url-Key set to ``True`` or
208 if you have not supplied the X-Storage-Url.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100209
210Any of the `swiftclient connection parameters`_ can also be defined
211here by the same name. Including the os_options by their key name (
212``for example tenant_id``)
213
214.. _swiftclient connection parameters: http://docs.openstack.org/developer/python-swiftclient/swiftclient.html#module-swiftclient.client
215
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100216**region_name** (optional)
217 The region name holding the swift container
218 ``For example, SYD``
219
220Each destination defined by the :ref:`jobs` will have the following
221default values that it may overwrite.
222
223**default_container** (optional)
224 Container name to place the log into
225 ``For example, logs``
226
227**default_expiry** (optional)
228 How long the signed destination should be available for
229 ``default: 7200 (2hrs)``
230
231**default_max_file_size** (optional)
232 The maximum size of an individual file
233 ``default: 104857600 (100MB)``
234
235**default_max_file_count** (optional)
236 The maximum number of separate files to allow
237 ``default: 10``
238
239**default_logserver_prefix**
240 Provide a URL to the CDN or logserver app so that a worker knows
241 what URL to return. The worker should return the logserver_prefix
242 url and the object path.
243 ``For example: http://logs.example.org/server.app?obj=``
244
Joshua Heskethfe485c62015-08-11 23:42:34 +1000245.. _connection:
246
247connection ArbitraryName
248""""""""""""""""""""""""
249
250A connection can be listed with any arbitrary name. The required
251parameters are specified in the :ref:`connections` documentation
252depending on what driver you are using.
253
254.. _layoutyaml:
255
James E. Blaircdd00072012-06-08 19:17:28 -0700256layout.yaml
257~~~~~~~~~~~
258
Clark Boylan00635dc2012-09-19 14:03:08 -0700259This is the main configuration file for Zuul, where all of the pipelines
James E. Blaircdd00072012-06-08 19:17:28 -0700260and projects are defined, what tests should be run, and what actions
Clark Boylan00635dc2012-09-19 14:03:08 -0700261Zuul should perform. There are three sections: pipelines, jobs, and
James E. Blaircdd00072012-06-08 19:17:28 -0700262projects.
263
James E. Blaire5a847f2012-07-10 15:29:14 -0700264.. _includes:
265
266Includes
267""""""""
268
269Custom functions to be used in Zuul's configuration may be provided
270using the ``includes`` directive. It accepts a list of files to
271include, and currently supports one type of inclusion, a python file::
272
273 includes:
274 - python-file: local_functions.py
275
276**python-file**
Antoine Musso9adc6d42014-11-14 15:37:48 +0100277 The path to a python file (either an absolute path or relative to the
278 directory name of :ref:`layout_config <layout_config>`). The
279 file will be loaded and objects that it defines will be placed in a
280 special environment which can be referenced in the Zuul configuration.
281 Currently only the parameter-function attribute of a Job uses this
282 feature.
James E. Blaire5a847f2012-07-10 15:29:14 -0700283
Clark Boylan00635dc2012-09-19 14:03:08 -0700284Pipelines
285"""""""""
James E. Blaircdd00072012-06-08 19:17:28 -0700286
Clark Boylan00635dc2012-09-19 14:03:08 -0700287Zuul can have any number of independent pipelines. Whenever a matching
288Gerrit event is found for a pipeline, that event is added to the
289pipeline, and the jobs specified for that pipeline are run. When all
290jobs specified for the pipeline that were triggered by an event are
291completed, Zuul reports back to Gerrit the results.
James E. Blaircdd00072012-06-08 19:17:28 -0700292
Clark Boylan00635dc2012-09-19 14:03:08 -0700293There are no pre-defined pipelines in Zuul, rather you can define
294whatever pipelines you need in the layout file. This is a very flexible
295system that can accommodate many kinds of workflows.
James E. Blaircdd00072012-06-08 19:17:28 -0700296
Clark Boylan00635dc2012-09-19 14:03:08 -0700297Here is a quick example of a pipeline definition followed by an
James E. Blaircdd00072012-06-08 19:17:28 -0700298explanation of each of the parameters::
299
300 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700301 manager: IndependentPipelineManager
Joshua Heskethfe485c62015-08-11 23:42:34 +1000302 source: my_gerrit
James E. Blaircdd00072012-06-08 19:17:28 -0700303 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000304 my_gerrit:
James E. Blair6c358e72013-07-29 17:06:47 -0700305 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700306 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000307 my_gerrit:
308 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700309 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000310 my_gerrit
311 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700312
313**name**
314 This is used later in the project definition to indicate what jobs
Clark Boylan00635dc2012-09-19 14:03:08 -0700315 should be run for events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700316
James E. Blair8dbd56a2012-12-22 10:55:10 -0800317**description**
318 This is an optional field that may be used to provide a textual
319 description of the pipeline.
320
James E. Blairc0dedf82014-08-06 09:37:52 -0700321**source**
Joshua Heskethfe485c62015-08-11 23:42:34 +1000322 A required field that specifies a connection that provides access to
323 the change objects that this pipeline operates on. The name of the
324 connection as per the zuul.conf should be specified. The driver used
325 for the connection named will be the source. Currently only ``gerrit``
326 drivers are supported.
James E. Blairc0dedf82014-08-06 09:37:52 -0700327
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
Joshua Heskethfe485c62015-08-11 23:42:34 +1000403 the pipelines they match.
James E. Blaircdd00072012-06-08 19:17:28 -0700404
Joshua Heskethfe485c62015-08-11 23:42:34 +1000405 Triggers are loaded from their connection name. The driver type of
406 the connection will dictate which options are available.
407 See :doc:`triggers`.
James E. Blairc494d542014-08-06 09:23:52 -0700408
James E. Blair11041d22014-05-02 14:49:53 -0700409**require**
410 If this section is present, it established pre-requisites for any
411 kind of item entering the Pipeline. Regardless of how the item is
412 to be enqueued (via any trigger or automatic dependency resolution),
413 the conditions specified here must be met or the item will not be
414 enqueued.
415
Antoine Musso27ab0d52014-10-22 14:20:17 +0200416.. _pipeline-require-approval:
417
James E. Blair5bf78a32015-07-30 18:08:24 +0000418 **approval**
James E. Blair11041d22014-05-02 14:49:53 -0700419 This requires that a certain kind of approval be present for the
420 current patchset of the change (the approval could be added by the
421 event in question). It takes several sub-parameters, all of which
422 are optional and are combined together so that there must be an
423 approval matching all specified requirements.
424
425 *username*
James E. Blairb01ec542016-06-16 09:46:49 -0700426 If present, an approval from this username is required. It is
427 treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700428
James E. Blair1fbfceb2014-06-23 14:42:53 -0700429 *email*
James E. Blair11041d22014-05-02 14:49:53 -0700430 If present, an approval with this email address is required. It
James E. Blairb01ec542016-06-16 09:46:49 -0700431 is treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700432
James E. Blair1fbfceb2014-06-23 14:42:53 -0700433 *email-filter* (deprecated)
434 A deprecated alternate spelling of *email*. Only one of *email* or
435 *email_filter* should be used.
436
James E. Blair11041d22014-05-02 14:49:53 -0700437 *older-than*
438 If present, the approval must be older than this amount of time
439 to match. Provide a time interval as a number with a suffix of
440 "w" (weeks), "d" (days), "h" (hours), "m" (minutes), "s"
441 (seconds). Example ``48h`` or ``2d``.
442
443 *newer-than*
444 If present, the approval must be newer than this amount of time
445 to match. Same format as "older-than".
446
447 Any other field is interpreted as a review category and value
448 pair. For example ``verified: 1`` would require that the approval
James E. Blair9c17dbf2014-06-23 14:21:58 -0700449 be for a +1 vote in the "Verified" column. The value may either
450 be a single value or a list: ``verified: [1, 2]`` would match
451 either a +1 or +2 vote.
James E. Blair11041d22014-05-02 14:49:53 -0700452
453 **open**
454 A boolean value (``true`` or ``false``) that indicates whether the change
455 must be open or closed in order to be enqueued.
456
Clark Boylana9702ad2014-05-08 17:17:24 -0700457 **current-patchset**
458 A boolean value (``true`` or ``false``) that indicates whether the change
459 must be the current patchset in order to be enqueued.
460
James E. Blair11041d22014-05-02 14:49:53 -0700461 **status**
462 A string value that corresponds with the status of the change
463 reported by the trigger. For example, when using the Gerrit
464 trigger, status values such as ``NEW`` or ``MERGED`` may be useful.
James E. Blair63bb0ef2013-07-29 17:14:51 -0700465
Joshua Hesketh66c8e522014-06-26 15:30:08 +1000466**reject**
467 If this section is present, it establishes pre-requisites that can
468 block an item from being enqueued. It can be considered a negative
469 version of **require**.
470
471 **approval**
472 This takes a list of approvals. If an approval matches the provided
473 criteria the change can not be entered into the pipeline. It follows
474 the same syntax as the :ref:`"require approval" pipeline above
475 <pipeline-require-approval>`.
476
477 Example to reject a change with any negative vote::
478
479 reject:
480 approval:
481 - code-review: [-1, -2]
482
James E. Blair2fa50962013-01-30 21:50:41 -0800483**dequeue-on-new-patchset**
484 Normally, if a new patchset is uploaded to a change that is in a
485 pipeline, the existing entry in the pipeline will be removed (with
486 jobs canceled and any dependent changes that can no longer merge as
487 well. To suppress this behavior (and allow jobs to continue
488 running), set this to ``false``. Default: ``true``.
489
James E. Blair17dd6772015-02-09 14:45:18 -0800490**ignore-dependencies**
491 In any kind of pipeline (dependent or independent), Zuul will
492 attempt to enqueue all dependencies ahead of the current change so
493 that they are tested together (independent pipelines report the
494 results of each change regardless of the results of changes ahead).
495 To ignore dependencies completely in an independent pipeline, set
496 this to ``true``. This option is ignored by dependent pipelines.
497 The default is: ``false``.
498
James E. Blaircdd00072012-06-08 19:17:28 -0700499**success**
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000500 Describes where Zuul should report to if all the jobs complete
501 successfully.
James E. Blaircdd00072012-06-08 19:17:28 -0700502 This section is optional; if it is omitted, Zuul will run jobs and
503 do nothing on success; it will not even report a message to Gerrit.
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000504 If the section is present, the listed reporter plugins will be
505 asked to report on the jobs.
Joshua Heskethfe485c62015-08-11 23:42:34 +1000506 The reporters are listed by their connection name. The options
507 available depend on the driver for the supplied connection.
508 See :doc:`reporters` for more details.
James E. Blaircdd00072012-06-08 19:17:28 -0700509
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400510**failure**
James E. Blaircdd00072012-06-08 19:17:28 -0700511 Uses the same syntax as **success**, but describes what Zuul should
512 do if at least one job fails.
James E. Blairdc253862012-06-13 17:12:42 -0700513
Joshua Heskethb7179772014-01-30 23:30:46 +1100514**merge-failure**
515 Uses the same syntax as **success**, but describes what Zuul should
516 do if it is unable to merge in the patchset. If no merge-failure
517 reporters are listed then the ``failure`` reporters will be used to
518 notify of unsuccessful merges.
519
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400520**start**
James E. Blairdc253862012-06-13 17:12:42 -0700521 Uses the same syntax as **success**, but describes what Zuul should
Clark Boylan00635dc2012-09-19 14:03:08 -0700522 do when a change is added to the pipeline manager. This can be used,
James E. Blairdc253862012-06-13 17:12:42 -0700523 for example, to reset the value of the Verified review category.
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400524
Joshua Hesketh89e829d2015-02-10 16:29:45 +1100525**disabled**
526 Uses the same syntax as **success**, but describes what Zuul should
527 do when a pipeline is disabled.
528 See ``disable-after-consecutive-failures``.
529
530**disable-after-consecutive-failures**
531 If set, a pipeline can enter a ''disabled'' state if too many changes
532 in a row fail. When this value is exceeded the pipeline will stop
533 reporting to any of the ``success``, ``failure`` or ``merge-failure``
534 reporters and instead only report to the ``disabled`` reporters.
535 (No ``start`` reports are made when a pipeline is disabled).
536
James E. Blair64ed6f22013-07-10 14:07:23 -0700537**precedence**
538 Indicates how the build scheduler should prioritize jobs for
539 different pipelines. Each pipeline may have one precedence, jobs
540 for pipelines with a higher precedence will be run before ones with
541 lower. The value should be one of ``high``, ``normal``, or ``low``.
542 Default: ``normal``.
543
Clark Boylanc2d19e42014-01-23 14:08:58 -0800544**window**
545 DependentPipelineManagers only. Zuul can rate limit
546 DependentPipelineManagers in a manner similar to TCP flow control.
547 Jobs are only started for changes in the queue if they sit in the
548 actionable window for the pipeline. The initial length of this window
549 is configurable with this value. The value given should be a positive
550 integer value. A value of ``0`` disables rate limiting on the
551 DependentPipelineManager.
552 Default: ``20``.
553
554**window-floor**
555 DependentPipelineManagers only. This is the minimum value for the
556 window described above. Should be a positive non zero integer value.
557 Default: ``3``.
558
559**window-increase-type**
560 DependentPipelineManagers only. This value describes how the window
561 should grow when changes are successfully merged by zuul. A value of
562 ``linear`` indicates that ``window-increase-factor`` should be added
563 to the previous window value. A value of ``exponential`` indicates
564 that ``window-increase-factor`` should be multiplied against the
565 previous window value and the result will become the window size.
566 Default: ``linear``.
567
568**window-increase-factor**
Clint Adams041ae512015-06-16 20:02:29 -0400569 DependentPipelineManagers only. The value to be added or multiplied
Clark Boylanc2d19e42014-01-23 14:08:58 -0800570 against the previous window value to determine the new window after
571 successful change merges.
572 Default: ``1``.
573
574**window-decrease-type**
575 DependentPipelineManagers only. This value describes how the window
576 should shrink when changes are not able to be merged by Zuul. A value
577 of ``linear`` indicates that ``window-decrease-factor`` should be
578 subtracted from the previous window value. A value of ``exponential``
579 indicates that ``window-decrease-factor`` should be divided against
580 the previous window value and the result will become the window size.
581 Default: ``exponential``.
582
583**window-decrease-factor**
584 DependentPipelineManagers only. The value to be subtracted or divided
585 against the previous window value to determine the new window after
586 unsuccessful change merges.
587 Default: ``2``.
588
Clark Boylan00635dc2012-09-19 14:03:08 -0700589Some example pipeline configurations are included in the sample layout
590file. The first is called a *check* pipeline::
James E. Blaircdd00072012-06-08 19:17:28 -0700591
592 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700593 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700594 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000595 my_gerrit:
596 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700597 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000598 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000599 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700600 failure:
Thomas Bechtolda8c0dbd2015-12-10 07:16:54 +0100601 my_gerrit:
602 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700603
604This will trigger jobs each time a new patchset (or change) is
605uploaded to Gerrit, and report +/-1 values to Gerrit in the
606``verified`` review category. ::
607
608 - name: gate
Clark Boylan00635dc2012-09-19 14:03:08 -0700609 manager: DependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700610 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000611 my_gerrit:
612 - event: comment-added
613 approval:
614 - approved: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700615 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000616 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000617 verified: 2
618 submit: true
James E. Blaircdd00072012-06-08 19:17:28 -0700619 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000620 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000621 verified: -2
James E. Blaircdd00072012-06-08 19:17:28 -0700622
623This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the
624``approved`` review category in Gerrit (a non-standard category).
625Changes will be tested in such a way as to guarantee that they will be
626merged exactly as tested, though that will happen in parallel by
627creating a virtual queue of dependent changes and performing
628speculative execution of jobs. ::
629
630 - name: post
Clark Boylan00635dc2012-09-19 14:03:08 -0700631 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700632 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000633 my_gerrit:
634 - event: ref-updated
635 ref: ^(?!refs/).*$
James E. Blaircdd00072012-06-08 19:17:28 -0700636
637This will trigger jobs whenever a change is merged to a named branch
638(e.g., ``master``). No output will be reported to Gerrit. This is
639useful for side effects such as creating per-commit tarballs. ::
640
641 - name: silent
Clark Boylan00635dc2012-09-19 14:03:08 -0700642 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700643 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000644 my_gerrit:
645 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700646
647This also triggers jobs when changes are uploaded to Gerrit, but no
648results are reported to Gerrit. This is useful for jobs that are in
Antoine Mussoce333842012-10-16 14:42:35 +0200649development and not yet ready to be presented to developers. ::
650
651 pipelines:
652 - name: post-merge
653 manager: IndependentPipelineManager
654 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000655 my_gerrit:
656 - event: change-merged
Antoine Mussoce333842012-10-16 14:42:35 +0200657 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000658 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000659 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200660 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000661 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000662 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200663
664The ``change-merged`` events happen when a change has been merged in the git
665repository. The change is thus closed and Gerrit will not accept modifications
666to the review scoring such as ``code-review`` or ``verified``. By using the
667``force-message: True`` parameter, Zuul will pass ``--force-message`` to the
668``gerrit review`` command, thus making sure the message is actually
669sent back to Gerrit regardless of approval scores.
670That kind of pipeline is nice to run regression or performance tests.
671
672.. note::
673 The ``change-merged`` event does not include the commit sha1 which can be
674 hazardous, it would let you report back to Gerrit though. If you were to
Michael Prokop526926a2013-10-24 16:16:57 +0200675 build a tarball for a specific commit, you should consider instead using
Łukasz Jernaś048acb42014-03-02 18:49:41 +0100676 the ``ref-updated`` event which does include the commit sha1 (but lacks the
Antoine Mussoce333842012-10-16 14:42:35 +0200677 Gerrit change number).
James E. Blaircdd00072012-06-08 19:17:28 -0700678
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100679
680.. _jobs:
681
James E. Blaircdd00072012-06-08 19:17:28 -0700682Jobs
683""""
684
685The jobs section is optional, and can be used to set attributes of
686jobs that are independent of their association with a project. For
687example, if a job should return a customized message on failure, that
688may be specified here. Otherwise, Zuul does not need to be told about
689each job as it builds a list from the project specification.
690
691**name**
692 The name of the job. This field is treated as a regular expression
693 and will be applied to each job that matches.
694
James E. Blairc8a1e052014-02-25 09:29:26 -0800695**queue-name (optional)**
696 Zuul will automatically combine projects that share a job into
697 shared change queues for dependent pipeline managers. In order to
698 report statistics about these queues, it is convenient for them to
699 have names. Zuul can automatically name change queues, however
700 these can grow quite long and are prone to changing as projects in
701 the queue change. If you assign a queue-name to a job, Zuul will
702 use that as the name for the shared change queue that contains that
703 job instead of the automatically generated one. It is an error for
704 a shared change queue to have more than one job with a queue-name if
705 they are not the same.
706
James E. Blaire5a847f2012-07-10 15:29:14 -0700707**failure-message (optional)**
708 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700709
James E. Blaire5a847f2012-07-10 15:29:14 -0700710**success-message (optional)**
711 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700712
James E. Blair6aea36d2012-12-17 13:03:24 -0800713**failure-pattern (optional)**
714 The URL that should be reported to Gerrit if the job fails.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700715 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800716 zuul.conf. May be supplied as a string pattern with substitutions
717 as described in url_pattern in :ref:`zuulconf`.
718
719**success-pattern (optional)**
720 The URL that should be reported to Gerrit if the job succeeds.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700721 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800722 zuul.conf. May be supplied as a string pattern with substitutions
723 as described in url_pattern in :ref:`zuulconf`.
724
James E. Blair222d4982012-07-16 09:31:19 -0700725**hold-following-changes (optional)**
726 This is a boolean that indicates that changes that follow this
Clark Boylan00635dc2012-09-19 14:03:08 -0700727 change in a dependent change pipeline should wait until this job
James E. Blair222d4982012-07-16 09:31:19 -0700728 succeeds before launching. If this is applied to a very short job
729 that can predict whether longer jobs will fail early, this can be
730 used to reduce the number of jobs that Zuul will launch and
731 ultimately have to cancel. In that case, a small amount of
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400732 parallelization of jobs is traded for more efficient use of testing
James E. Blair222d4982012-07-16 09:31:19 -0700733 resources. On the other hand, to apply this to a long running job
734 would largely defeat the parallelization of dependent change testing
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400735 that is the main feature of Zuul. Default: ``false``.
James E. Blair222d4982012-07-16 09:31:19 -0700736
James E. Blairaf17a972016-02-03 15:07:18 -0800737**mutex (optional)**
738 This is a string that names a mutex that should be observed by this
739 job. Only one build of any job that references the same named mutex
740 will be enqueued at a time. This applies across all pipelines.
741
James E. Blaire5a847f2012-07-10 15:29:14 -0700742**branch (optional)**
James E. Blaircdd00072012-06-08 19:17:28 -0700743 This job should only be run on matching branches. This field is
744 treated as a regular expression and multiple branches may be
745 listed.
746
James E. Blair70c71582013-03-06 08:50:50 -0800747**files (optional)**
748 This job should only be run if at least one of the files involved in
749 the change (added, deleted, or modified) matches at least one of the
750 file patterns listed here. This field is treated as a regular
751 expression and multiple expressions may be listed.
752
Maru Newby3fe5f852015-01-13 04:22:14 +0000753**skip-if (optional)**
754
755 This job should not be run if all the patterns specified by the
756 optional fields listed below match on their targets. When multiple
757 sets of parameters are provided, this job will be skipped if any set
758 matches. For example: ::
759
760 jobs:
761 - name: check-tempest-dsvm-neutron
762 skip-if:
763 - project: ^openstack/neutron$
764 branch: ^stable/juno$
765 all-files-match-any:
766 - ^neutron/tests/.*$
767 - ^tools/.*$
768 - all-files-match-any:
769 - ^doc/.*$
770 - ^.*\.rst$
771
772 With this configuration, the job would be skipped for a neutron
773 patchset for the stable/juno branch provided that every file in the
774 change matched at least one of the specified file regexes. The job
775 will also be skipped for any patchset that modified only the doc
776 tree or rst files.
777
778 *project* (optional)
779 The regular expression to match against the project of the change.
780
781 *branch* (optional)
782 The regular expression to match against the branch or ref of the
783 change.
784
785 *all-files-match-any* (optional)
786 A list of regular expressions intended to match the files involved
787 in the change. This parameter will be considered matching a
788 change only if all files in a change match at least one of these
789 expressions.
790
791 The pattern for '/COMMIT_MSG' is always matched on and does not
Alexander Evseevdbe6fab2015-11-19 12:46:34 +0300792 have to be included. Exception is merge commits (without modified
793 files), in this case '/COMMIT_MSG' is not matched, and job is not
794 skipped. In case of merge commits it's assumed that list of modified
795 files isn't predictible and CI should be run.
Maru Newby3fe5f852015-01-13 04:22:14 +0000796
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400797**voting (optional)**
798 Boolean value (``true`` or ``false``) that indicates whatever
799 a job is voting or not. Default: ``true``.
800
James E. Blair456f2fb2016-02-09 09:29:33 -0800801**tags (optional)**
802 A list of arbitrary strings which will be associated with the job.
803 Can be used by the parameter-function to alter behavior based on
804 their presence on a job. If the job name is a regular expression,
805 tags will accumulate on jobs that match.
806
James E. Blaire5a847f2012-07-10 15:29:14 -0700807**parameter-function (optional)**
808 Specifies a function that should be applied to the parameters before
809 the job is launched. The function should be defined in a python file
810 included with the :ref:`includes` directive. The function
811 should have the following signature:
812
James E. Blaird0470972013-07-29 10:05:43 -0700813 .. function:: parameters(item, job, parameters)
James E. Blaire5a847f2012-07-10 15:29:14 -0700814
815 Manipulate the parameters passed to a job before a build is
816 launched. The ``parameters`` dictionary will already contain the
817 standard Zuul job parameters, and is expected to be modified
818 in-place.
819
James E. Blaird78576a2013-07-09 10:39:17 -0700820 :param item: the current queue item
821 :type item: zuul.model.QueueItem
James E. Blaird0470972013-07-29 10:05:43 -0700822 :param job: the job about to be run
823 :type job: zuul.model.Job
James E. Blaire5a847f2012-07-10 15:29:14 -0700824 :param parameters: parameters to be passed to the job
825 :type parameters: dict
826
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700827 If the parameter **ZUUL_NODE** is set by this function, then it will
828 be used to specify on what node (or class of node) the job should be
829 run.
830
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100831**swift**
832 If :ref:`swift` is configured then each job can define a destination
833 container for the builder to place logs and/or assets into. Multiple
834 containers can be listed for each job by providing a unique ``name``.
835
836 *name*
837 Set an identifying name for the container. This is used in the
838 parameter key sent to the builder. For example if it ``logs`` then
839 one of the parameters sent will be ``SWIFT_logs_CONTAINER``
840 (case-sensitive).
841
842 Each of the defaults defined in :ref:`swift` can be overwritten as:
843
844 *container* (optional)
845 Container name to place the log into
846 ``For example, logs``
847
848 *expiry* (optional)
849 How long the signed destination should be available for
850
James E. Blaird6500232014-06-23 15:05:48 -0700851 *max-file-size** (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100852 The maximum size of an individual file
853
James E. Blaird6500232014-06-23 15:05:48 -0700854 *max_file_size** (optional, deprecated)
855 A deprecated alternate spelling of *max-file-size*.
856
857 *max-file-count* (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100858 The maximum number of separate files to allow
859
James E. Blaird6500232014-06-23 15:05:48 -0700860 *max_file_count* (optional, deprecated)
861 A deprecated alternate spelling of *max-file-count*.
862
863 *logserver-prefix*
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100864 Provide a URL to the CDN or logserver app so that a worker knows
865 what URL to return.
866 ``For example: http://logs.example.org/server.app?obj=``
James E. Blaird6500232014-06-23 15:05:48 -0700867 The worker should return the logserver-prefix url and the object
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100868 path as the URL in the results data packet.
869
James E. Blaird6500232014-06-23 15:05:48 -0700870 *logserver_prefix* (deprecated)
871 A deprecated alternate spelling of *logserver-prefix*.
872
James E. Blaircdd00072012-06-08 19:17:28 -0700873Here is an example of setting the failure message for jobs that check
874whether a change merges cleanly::
875
876 - name: ^.*-merge$
Jeremy Stanley1c2c3c22015-06-15 21:23:19 +0000877 failure-message: This change or one of its cross-repo dependencies
878 was unable to be automatically merged with the current state of
879 its repository. Please rebase the change and upload a new
880 patchset.
James E. Blaircdd00072012-06-08 19:17:28 -0700881
882Projects
883""""""""
884
Clark Boylan00635dc2012-09-19 14:03:08 -0700885The projects section indicates what jobs should be run in each pipeline
James E. Blaircdd00072012-06-08 19:17:28 -0700886for events associated with each project. It contains a list of
887projects. Here is an example::
888
889 - name: example/project
890 check:
891 - project-merge:
892 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700893 - project-pep8
894 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700895 gate:
896 - project-merge:
897 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700898 - project-pep8
899 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700900 post:
901 - project-publish
902
903**name**
904 The name of the project (as known by Gerrit).
905
James E. Blair19deff22013-08-25 13:17:35 -0700906**merge-mode (optional)**
907 An optional value that indicates what strategy should be used to
908 merge changes to this project. Supported values are:
909
910 ** merge-resolve **
911 Equivalent to 'git merge -s resolve'. This corresponds closely to
912 what Gerrit performs (using JGit) for a project if the "Merge if
913 necessary" merge mode is selected and "Automatically resolve
914 conflicts" is checked. This is the default.
915
916 ** merge **
917 Equivalent to 'git merge'.
918
919 ** cherry-pick **
920 Equivalent to 'git cherry-pick'.
921
Clark Boylan00635dc2012-09-19 14:03:08 -0700922This is followed by a section for each of the pipelines defined above.
923Pipelines may be omitted if no jobs should run for this project in a
924given pipeline. Within the pipeline section, the jobs that should be
James E. Blaircdd00072012-06-08 19:17:28 -0700925executed are listed. If a job is entered as a dictionary key, then
926jobs contained within that key are only executed if the key job
927succeeds. In the above example, project-unittest, project-pep8, and
928project-pyflakes are only executed if project-merge succeeds. This
929can help avoid running unnecessary jobs.
930
James E. Blair18c64442014-03-18 10:14:45 -0700931The special job named ``noop`` is internal to Zuul and will always
932return ``SUCCESS`` immediately. This can be useful if you require
933that all changes be processed by a pipeline but a project has no jobs
934that can be run on it.
935
Andreas Jaegerbcfbf932014-09-29 20:21:44 +0200936.. 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 -0700937
Antoine Musso80edd5a2013-02-13 15:37:53 +0100938Project Templates
939"""""""""""""""""
940
Michael Prokop526926a2013-10-24 16:16:57 +0200941Whenever you have lot of similar projects (such as plugins for a project) you
Antoine Musso80edd5a2013-02-13 15:37:53 +0100942will most probably want to use the same pipeline configurations. The
943project templates let you define pipelines and job name templates to trigger.
944One can then just apply the template on its project which make it easier to
Michael Prokop526926a2013-10-24 16:16:57 +0200945update several similar projects. As an example::
Antoine Musso80edd5a2013-02-13 15:37:53 +0100946
947 project-templates:
948 # Name of the template
949 - name: plugin-triggering
950 # Definition of pipelines just like for a `project`
951 check:
952 - '{jobprefix}-merge':
953 - '{jobprefix}-pep8'
954 - '{jobprefix}-pyflakes'
955 gate:
956 - '{jobprefix}-merge':
957 - '{jobprefix}-unittest'
958 - '{jobprefix}-pep8'
959 - '{jobprefix}-pyflakes'
960
961In your projects definition, you will then apply the template using the template
962key::
963
964 projects:
965 - name: plugin/foobar
966 template:
967 - name: plugin-triggering
968 jobprefix: plugin-foobar
969
James E. Blairaea6cf62013-12-16 15:38:12 -0800970You can pass several parameters to a template. A ``parameter`` value
971will be used for expansion of ``{parameter}`` in the template
972strings. The parameter ``name`` will be automatically provided and
973will contain the short name of the project, that is the portion of the
974project name after the last ``/`` character.
James E. Blaircdd00072012-06-08 19:17:28 -0700975
James E. Blair3e98c022013-12-16 15:25:38 -0800976Multiple templates can be combined in a project, and the jobs from all
977of those templates will be added to the project. Individual jobs may
978also be added::
979
980 projects:
981 - name: plugin/foobar
982 template:
983 - name: plugin-triggering
984 jobprefix: plugin-foobar
985 - name: plugin-extras
986 jobprefix: plugin-foobar
987 check:
988 - foobar-extra-special-job
989
Steven Dake21ef9ad2014-08-25 23:08:14 -0700990Individual jobs may optionally be added to pipelines (e.g. check,
Atsushi SAKAI5d7e93b2015-07-28 22:15:48 +0900991gate, et cetera) for a project, in addition to those provided by
Steven Dake21ef9ad2014-08-25 23:08:14 -0700992templates.
993
James E. Blair3e98c022013-12-16 15:25:38 -0800994The order of the jobs listed in the project (which only affects the
995order of jobs listed on the report) will be the jobs from each
996template in the order listed, followed by any jobs individually listed
997for the project.
998
999Note that if multiple templates are used for a project and one
1000template specifies a job that is also specified in another template,
James E. Blair12a92b12014-03-26 11:54:53 -07001001or specified in the project itself, the configuration defined by
1002either the last template or the project itself will take priority.
James E. Blair3e98c022013-12-16 15:25:38 -08001003
James E. Blaircdd00072012-06-08 19:17:28 -07001004logging.conf
1005~~~~~~~~~~~~
1006This file is optional. If provided, it should be a standard
1007:mod:`logging.config` module configuration file. If not present, Zuul will
1008output all log messages of DEBUG level or higher to the console.
1009
1010Starting Zuul
1011-------------
1012
1013To start Zuul, run **zuul-server**::
1014
Antoine Mussob3aa8282013-04-19 15:16:59 +02001015 usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version]
James E. Blaircdd00072012-06-08 19:17:28 -07001016
1017 Project gating system.
1018
1019 optional arguments:
1020 -h, --help show this help message and exit
1021 -c CONFIG specify the config file
Antoine Mussob3aa8282013-04-19 15:16:59 +02001022 -l LAYOUT specify the layout file
James E. Blaircdd00072012-06-08 19:17:28 -07001023 -d do not run as a daemon
Antoine Mussob3aa8282013-04-19 15:16:59 +02001024 -t validate layout file syntax
1025 --version show zuul version
James E. Blaircdd00072012-06-08 19:17:28 -07001026
1027You may want to use the ``-d`` argument while you are initially setting
1028up Zuul so you can detect any configuration errors quickly. Under
1029normal operation, omit ``-d`` and let Zuul run as a daemon.
1030
1031If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will
1032stop executing new jobs, wait until all executing jobs are finished,
Joshua Heskethc4997152016-02-17 21:04:18 +11001033reload its layout.yaml, and resume. Changes to any connections or
1034the PID file will be ignored until Zuul is restarted.
Clark Boylanf231fa22013-02-08 12:28:53 -08001035
1036If you send a SIGUSR1 to the zuul-server process, Zuul will stop
1037executing new jobs, wait until all executing jobs are finished,
1038then exit. While waiting to exit Zuul will queue Gerrit events and
1039save these events prior to exiting. When Zuul starts again it will
1040read these saved events and act on them.
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001041
Michael Prokop526926a2013-10-24 16:16:57 +02001042If you need to abort Zuul and intend to manually requeue changes for
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001043jobs which were running in its pipelines, prior to terminating you can
1044use the zuul-changes.py tool script to simplify the process. For
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001045example, this would give you a list of zuul-enqueue commands to requeue
1046changes for the gate and check pipelines respectively::
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001047
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001048 ./tools/zuul-changes.py http://zuul.openstack.org/ gate
1049 ./tools/zuul-changes.py http://zuul.openstack.org/ check
Clark Boylanfba9b242013-08-20 10:11:17 -07001050
Antoine Musso29eab012014-10-28 21:35:22 +01001051If you send a SIGUSR2 to the zuul-server process, or the forked process
1052that runs the Gearman daemon, Zuul will dump a stack trace for each
1053running thread into its debug log. It is written under the log bucket
1054``zuul.stack_dump``. This is useful for tracking down deadlock or
1055otherwise slow threads.
Antoine Mussod0f06262014-06-04 09:54:24 +02001056
1057When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python
1058Profiler) is available, additional functions' and threads' stats are
1059emitted as well. The first SIGUSR2 will enable yappi, on the second
1060SIGUSR2 it dumps the information collected, resets all yappi state and
1061stops profiling. This is to minimize the impact of yappi on a running
1062system.