blob: 27e7f4cc5a44b26cc009a8c80779c0950e063b71 [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
Paul Belanger9208dc12016-06-08 16:43:55 -040055**check_job_registration**
56 Check to see if job is registered with Gearman or not. When True
57 a build result of NOT_REGISTERED will be return if job is not found.
58 ``check_job_registration=True``
59
James E. Blair77cc7b82013-07-15 13:22:37 -070060gearman_server
61""""""""""""""
62
Thanh Ha266cbb82016-01-24 20:57:59 -050063The builtin gearman server. Zuul can fork a gearman process from itself rather
64than connecting to an external one.
65
James E. Blair77cc7b82013-07-15 13:22:37 -070066**start**
67 Whether to start the internal Gearman server (default: False).
68 ``start=true``
69
James E. Blair0ac452e2015-07-22 09:05:16 -070070**listen_address**
71 IP address or domain name on which to listen (default: all addresses).
72 ``listen_address=127.0.0.1``
73
James E. Blair77cc7b82013-07-15 13:22:37 -070074**log_config**
75 Path to log config file for internal Gearman server.
76 ``log_config=/etc/zuul/gearman-logging.yaml``
77
Clark Boylan9b670902012-09-28 13:47:56 -070078zuul
79""""
80
Thanh Ha266cbb82016-01-24 20:57:59 -050081Zuul's main configuration section. At minimum zuul must be able to find
82layout.yaml to be useful.
83
84.. note:: Must be provided when running zuul-server
85
Antoine Musso9adc6d42014-11-14 15:37:48 +010086.. _layout_config:
87
Clark Boylan9b670902012-09-28 13:47:56 -070088**layout_config**
James E. Blair4076e2b2014-01-28 12:42:20 -080089 Path to layout config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070090 ``layout_config=/etc/zuul/layout.yaml``
91
92**log_config**
James E. Blaira4430132014-02-17 08:32:07 -080093 Path to log config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070094 ``log_config=/etc/zuul/logging.yaml``
95
96**pidfile**
James E. Blaira4430132014-02-17 08:32:07 -080097 Path to PID lock file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070098 ``pidfile=/var/run/zuul/zuul.pid``
99
100**state_dir**
James E. Blair4076e2b2014-01-28 12:42:20 -0800101 Path to directory that Zuul should save state to. Used by all Zuul
102 commands.
Clark Boylan9b670902012-09-28 13:47:56 -0700103 ``state_dir=/var/lib/zuul``
104
James E. Blair4076e2b2014-01-28 12:42:20 -0800105**report_times**
106 Boolean value (``true`` or ``false``) that determines if Zuul should
107 include elapsed times for each job in the textual report. Used by
108 zuul-server only.
109 ``report_times=true``
110
111**status_url**
112 URL that will be posted in Zuul comments made to Gerrit changes when
113 starting jobs for a change. Used by zuul-server only.
114 ``status_url=https://zuul.example.com/status``
115
Clark Boylane0b4bdb2014-06-03 17:01:25 -0700116**status_expiry**
117 Zuul will cache the status.json file for this many seconds. This is an
118 optional value and ``1`` is used by default.
119 ``status_expiry=1``
120
James E. Blair4076e2b2014-01-28 12:42:20 -0800121**url_pattern**
122 If you are storing build logs external to the system that originally
123 ran jobs and wish to link to those logs when Zuul makes comments on
124 Gerrit changes for completed jobs this setting configures what the
125 URLs for those links should be. Used by zuul-server only.
126 ``http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}``
127
128**job_name_in_report**
129 Boolean value (``true`` or ``false``) that indicates whether the
130 job name should be included in the report (normally only the URL
131 is included). Defaults to ``false``. Used by zuul-server only.
132 ``job_name_in_report=true``
133
134merger
135""""""
136
Thanh Ha266cbb82016-01-24 20:57:59 -0500137The zuul-merger process configuration. Detailed documentation on this process
138can be found on the :doc:`merger` page.
139
140.. note:: Must be provided when running zuul-merger. Both services may share the
141 same configuration (and even host) or otherwise have an individual
142 zuul.conf.
143
Clark Boylan9b670902012-09-28 13:47:56 -0700144**git_dir**
145 Directory that Zuul should clone local git repositories to.
146 ``git_dir=/var/lib/zuul/git``
147
Paul Belangerb67aba12013-05-13 19:22:14 -0400148**git_user_email**
149 Optional: Value to pass to `git config user.email`.
150 ``git_user_email=zuul@example.com``
151
152**git_user_name**
153 Optional: Value to pass to `git config user.name`.
154 ``git_user_name=zuul``
155
Arx Cruzb1b010d2013-10-28 19:49:59 -0200156**zuul_url**
James E. Blair4076e2b2014-01-28 12:42:20 -0800157 URL of this merger's git repos, accessible to test workers. Usually
158 "http://zuul.example.com/p" or "http://zuul-merger01.example.com/p"
159 depending on whether the merger is co-located with the Zuul server.
Arx Cruzb1b010d2013-10-28 19:49:59 -0200160
James E. Blaira4430132014-02-17 08:32:07 -0800161**log_config**
162 Path to log config file for the merger process.
163 ``log_config=/etc/zuul/logging.yaml``
164
165**pidfile**
166 Path to PID lock file for the merger process.
167 ``pidfile=/var/run/zuul-merger/merger.pid``
168
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100169.. _swift:
170
171swift
172"""""
173
174To send (optional) swift upload instructions this section must be
Antoine Musso62fa2d42014-06-04 22:55:23 +0200175present. Multiple destinations can be defined in the :ref:`jobs` section
176of the layout.
177
178If you are sending the temp-url-key or fetching the x-storage-url, you
179will need the python-swiftclient module installed.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100180
Joshua Heskethc4967502014-05-15 06:39:14 -0700181**X-Account-Meta-Temp-Url-Key** (optional)
182 This is the key used to sign the HMAC message. If you do not set a
183 key Zuul will generate one automatically.
184
185**Send-Temp-Url-Key** (optional)
186 Zuul can send the X-Account-Meta-Temp-Url-Key to swift for you if
187 you have set up the appropriate credentials in ``authurl`` below.
188 This isn't necessary if you know and have set your
189 X-Account-Meta-Temp-Url-Key.
Antoine Musso62fa2d42014-06-04 22:55:23 +0200190 If set, Zuul requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700191 ``default: true``
192
193**X-Storage-Url** (optional)
194 The storage URL is the destination to upload files into. If you do
195 not set this the ``authurl`` credentials are used to fetch the url
Antoine Musso62fa2d42014-06-04 22:55:23 +0200196 from swift and Zuul will requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700197
198**authurl** (optional)
199 The (keystone) Auth URL for swift.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100200 ``For example, https://identity.api.rackspacecloud.com/v2.0/``
Joshua Heskethc4967502014-05-15 06:39:14 -0700201 This is required if you have Send-Temp-Url-Key set to ``True`` or
202 if you have not supplied the X-Storage-Url.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100203
204Any of the `swiftclient connection parameters`_ can also be defined
205here by the same name. Including the os_options by their key name (
206``for example tenant_id``)
207
208.. _swiftclient connection parameters: http://docs.openstack.org/developer/python-swiftclient/swiftclient.html#module-swiftclient.client
209
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100210**region_name** (optional)
211 The region name holding the swift container
212 ``For example, SYD``
213
214Each destination defined by the :ref:`jobs` will have the following
215default values that it may overwrite.
216
217**default_container** (optional)
218 Container name to place the log into
219 ``For example, logs``
220
221**default_expiry** (optional)
222 How long the signed destination should be available for
223 ``default: 7200 (2hrs)``
224
225**default_max_file_size** (optional)
226 The maximum size of an individual file
227 ``default: 104857600 (100MB)``
228
229**default_max_file_count** (optional)
230 The maximum number of separate files to allow
231 ``default: 10``
232
233**default_logserver_prefix**
234 Provide a URL to the CDN or logserver app so that a worker knows
235 what URL to return. The worker should return the logserver_prefix
236 url and the object path.
237 ``For example: http://logs.example.org/server.app?obj=``
238
Joshua Heskethfe485c62015-08-11 23:42:34 +1000239.. _connection:
240
241connection ArbitraryName
242""""""""""""""""""""""""
243
244A connection can be listed with any arbitrary name. The required
245parameters are specified in the :ref:`connections` documentation
246depending on what driver you are using.
247
248.. _layoutyaml:
249
James E. Blaircdd00072012-06-08 19:17:28 -0700250layout.yaml
251~~~~~~~~~~~
252
Clark Boylan00635dc2012-09-19 14:03:08 -0700253This is the main configuration file for Zuul, where all of the pipelines
James E. Blaircdd00072012-06-08 19:17:28 -0700254and projects are defined, what tests should be run, and what actions
Clark Boylan00635dc2012-09-19 14:03:08 -0700255Zuul should perform. There are three sections: pipelines, jobs, and
James E. Blaircdd00072012-06-08 19:17:28 -0700256projects.
257
James E. Blaire5a847f2012-07-10 15:29:14 -0700258.. _includes:
259
260Includes
261""""""""
262
263Custom functions to be used in Zuul's configuration may be provided
264using the ``includes`` directive. It accepts a list of files to
265include, and currently supports one type of inclusion, a python file::
266
267 includes:
268 - python-file: local_functions.py
269
270**python-file**
Antoine Musso9adc6d42014-11-14 15:37:48 +0100271 The path to a python file (either an absolute path or relative to the
272 directory name of :ref:`layout_config <layout_config>`). The
273 file will be loaded and objects that it defines will be placed in a
274 special environment which can be referenced in the Zuul configuration.
275 Currently only the parameter-function attribute of a Job uses this
276 feature.
James E. Blaire5a847f2012-07-10 15:29:14 -0700277
Clark Boylan00635dc2012-09-19 14:03:08 -0700278Pipelines
279"""""""""
James E. Blaircdd00072012-06-08 19:17:28 -0700280
Clark Boylan00635dc2012-09-19 14:03:08 -0700281Zuul can have any number of independent pipelines. Whenever a matching
282Gerrit event is found for a pipeline, that event is added to the
283pipeline, and the jobs specified for that pipeline are run. When all
284jobs specified for the pipeline that were triggered by an event are
285completed, Zuul reports back to Gerrit the results.
James E. Blaircdd00072012-06-08 19:17:28 -0700286
Clark Boylan00635dc2012-09-19 14:03:08 -0700287There are no pre-defined pipelines in Zuul, rather you can define
288whatever pipelines you need in the layout file. This is a very flexible
289system that can accommodate many kinds of workflows.
James E. Blaircdd00072012-06-08 19:17:28 -0700290
Clark Boylan00635dc2012-09-19 14:03:08 -0700291Here is a quick example of a pipeline definition followed by an
James E. Blaircdd00072012-06-08 19:17:28 -0700292explanation of each of the parameters::
293
294 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700295 manager: IndependentPipelineManager
Joshua Heskethfe485c62015-08-11 23:42:34 +1000296 source: my_gerrit
James E. Blaircdd00072012-06-08 19:17:28 -0700297 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000298 my_gerrit:
James E. Blair6c358e72013-07-29 17:06:47 -0700299 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700300 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000301 my_gerrit:
302 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700303 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000304 my_gerrit
305 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700306
307**name**
308 This is used later in the project definition to indicate what jobs
Clark Boylan00635dc2012-09-19 14:03:08 -0700309 should be run for events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700310
James E. Blair8dbd56a2012-12-22 10:55:10 -0800311**description**
312 This is an optional field that may be used to provide a textual
313 description of the pipeline.
314
James E. Blairc0dedf82014-08-06 09:37:52 -0700315**source**
Joshua Heskethfe485c62015-08-11 23:42:34 +1000316 A required field that specifies a connection that provides access to
317 the change objects that this pipeline operates on. The name of the
318 connection as per the zuul.conf should be specified. The driver used
319 for the connection named will be the source. Currently only ``gerrit``
320 drivers are supported.
James E. Blairc0dedf82014-08-06 09:37:52 -0700321
James E. Blair56370192013-01-14 15:47:28 -0800322**success-message**
323 An optional field that supplies the introductory text in message
324 reported back to Gerrit when all the voting builds are successful.
325 Defaults to "Build successful."
326
327**failure-message**
328 An optional field that supplies the introductory text in message
329 reported back to Gerrit when at least one voting build fails.
330 Defaults to "Build failed."
331
Joshua Heskethb7179772014-01-30 23:30:46 +1100332**merge-failure-message**
333 An optional field that supplies the introductory text in message
334 reported back to Gerrit when a change fails to merge with the
335 current state of the repository.
336 Defaults to "Merge failed."
337
Joshua Hesketh3979e3e2014-03-04 11:21:10 +1100338**footer-message**
339 An optional field to supply additional information after test results.
340 Useful for adding information about the CI system such as debugging
341 and contact details.
342
James E. Blaircdd00072012-06-08 19:17:28 -0700343**manager**
Clark Boylan00635dc2012-09-19 14:03:08 -0700344 There are currently two schemes for managing pipelines:
James E. Blaircdd00072012-06-08 19:17:28 -0700345
Clark Boylan00635dc2012-09-19 14:03:08 -0700346 *IndependentPipelineManager*
347 Every event in this pipeline should be treated as independent of
348 other events in the pipeline. This is appropriate when the order of
349 events in the pipeline doesn't matter because the results of the
350 actions this pipeline performs can not affect other events in the
351 pipeline. For example, when a change is first uploaded for review,
James E. Blaircdd00072012-06-08 19:17:28 -0700352 you may want to run tests on that change to provide early feedback
353 to reviewers. At the end of the tests, the change is not going to
354 be merged, so it is safe to run these tests in parallel without
Clark Boylan00635dc2012-09-19 14:03:08 -0700355 regard to any other changes in the pipeline. They are independent.
James E. Blaircdd00072012-06-08 19:17:28 -0700356
Clark Boylan00635dc2012-09-19 14:03:08 -0700357 Another type of pipeline that is independent is a post-merge
358 pipeline. In that case, the changes have already merged, so the
359 results can not affect any other events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700360
Clark Boylan00635dc2012-09-19 14:03:08 -0700361 *DependentPipelineManager*
362 The dependent pipeline manager is designed for gating. It ensures
James E. Blaircdd00072012-06-08 19:17:28 -0700363 that every change is tested exactly as it is going to be merged
364 into the repository. An ideal gating system would test one change
365 at a time, applied to the tip of the repository, and only if that
366 change passed tests would it be merged. Then the next change in
367 line would be tested the same way. In order to achieve parallel
Clark Boylan00635dc2012-09-19 14:03:08 -0700368 testing of changes, the dependent pipeline manager performs
James E. Blaircdd00072012-06-08 19:17:28 -0700369 speculative execution on changes. It orders changes based on
Clark Boylan00635dc2012-09-19 14:03:08 -0700370 their entry into the pipeline. It begins testing all changes in
371 parallel, assuming that each change ahead in the pipeline will pass
James E. Blaircdd00072012-06-08 19:17:28 -0700372 its tests. If they all succeed, all the changes can be tested and
Clark Boylan00635dc2012-09-19 14:03:08 -0700373 merged in parallel. If a change near the front of the pipeline
374 fails its tests, each change behind it ignores whatever tests have
375 been completed and are tested again without the change in front.
376 This way gate tests may run in parallel but still be tested
377 correctly, exactly as they will appear in the repository when
378 merged.
James E. Blaircdd00072012-06-08 19:17:28 -0700379
Clark Boylan00635dc2012-09-19 14:03:08 -0700380 One important characteristic of the DependentPipelineManager is that
James E. Blaircdd00072012-06-08 19:17:28 -0700381 it analyzes the jobs that are triggered by different projects, and
382 if those projects have jobs in common, it treats those projects as
383 related, and they share a single virtual queue of changes. Thus,
384 if there is a job that performs integration testing on two
385 projects, those two projects will automatically share a virtual
386 change queue. If a third project does not invoke that job, it
Clark Boylan00635dc2012-09-19 14:03:08 -0700387 will be part of a separate virtual change queue, and changes to
388 it will not depend on changes to the first two jobs.
James E. Blaircdd00072012-06-08 19:17:28 -0700389
390 For more detail on the theory and operation of Zuul's
Clark Boylan00635dc2012-09-19 14:03:08 -0700391 DependentPipelineManager, see: :doc:`gating`.
James E. Blaircdd00072012-06-08 19:17:28 -0700392
393**trigger**
James E. Blairc494d542014-08-06 09:23:52 -0700394 At least one trigger source must be supplied for each pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700395 Triggers are not exclusive -- matching events may be placed in
James E. Blair6c358e72013-07-29 17:06:47 -0700396 multiple pipelines, and they will behave independently in each of
Joshua Heskethfe485c62015-08-11 23:42:34 +1000397 the pipelines they match.
James E. Blaircdd00072012-06-08 19:17:28 -0700398
Joshua Heskethfe485c62015-08-11 23:42:34 +1000399 Triggers are loaded from their connection name. The driver type of
400 the connection will dictate which options are available.
401 See :doc:`triggers`.
James E. Blairc494d542014-08-06 09:23:52 -0700402
James E. Blair11041d22014-05-02 14:49:53 -0700403**require**
404 If this section is present, it established pre-requisites for any
405 kind of item entering the Pipeline. Regardless of how the item is
406 to be enqueued (via any trigger or automatic dependency resolution),
407 the conditions specified here must be met or the item will not be
408 enqueued.
409
Antoine Musso27ab0d52014-10-22 14:20:17 +0200410.. _pipeline-require-approval:
411
James E. Blair5bf78a32015-07-30 18:08:24 +0000412 **approval**
James E. Blair11041d22014-05-02 14:49:53 -0700413 This requires that a certain kind of approval be present for the
414 current patchset of the change (the approval could be added by the
415 event in question). It takes several sub-parameters, all of which
416 are optional and are combined together so that there must be an
417 approval matching all specified requirements.
418
419 *username*
James E. Blairb01ec542016-06-16 09:46:49 -0700420 If present, an approval from this username is required. It is
421 treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700422
James E. Blair1fbfceb2014-06-23 14:42:53 -0700423 *email*
James E. Blair11041d22014-05-02 14:49:53 -0700424 If present, an approval with this email address is required. It
James E. Blairb01ec542016-06-16 09:46:49 -0700425 is treated as a regular expression.
James E. Blair11041d22014-05-02 14:49:53 -0700426
James E. Blair1fbfceb2014-06-23 14:42:53 -0700427 *email-filter* (deprecated)
428 A deprecated alternate spelling of *email*. Only one of *email* or
429 *email_filter* should be used.
430
James E. Blair11041d22014-05-02 14:49:53 -0700431 *older-than*
432 If present, the approval must be older than this amount of time
433 to match. Provide a time interval as a number with a suffix of
434 "w" (weeks), "d" (days), "h" (hours), "m" (minutes), "s"
435 (seconds). Example ``48h`` or ``2d``.
436
437 *newer-than*
438 If present, the approval must be newer than this amount of time
439 to match. Same format as "older-than".
440
441 Any other field is interpreted as a review category and value
442 pair. For example ``verified: 1`` would require that the approval
James E. Blair9c17dbf2014-06-23 14:21:58 -0700443 be for a +1 vote in the "Verified" column. The value may either
444 be a single value or a list: ``verified: [1, 2]`` would match
445 either a +1 or +2 vote.
James E. Blair11041d22014-05-02 14:49:53 -0700446
447 **open**
448 A boolean value (``true`` or ``false``) that indicates whether the change
449 must be open or closed in order to be enqueued.
450
Clark Boylana9702ad2014-05-08 17:17:24 -0700451 **current-patchset**
452 A boolean value (``true`` or ``false``) that indicates whether the change
453 must be the current patchset in order to be enqueued.
454
James E. Blair11041d22014-05-02 14:49:53 -0700455 **status**
456 A string value that corresponds with the status of the change
457 reported by the trigger. For example, when using the Gerrit
458 trigger, status values such as ``NEW`` or ``MERGED`` may be useful.
James E. Blair63bb0ef2013-07-29 17:14:51 -0700459
Joshua Hesketh66c8e522014-06-26 15:30:08 +1000460**reject**
461 If this section is present, it establishes pre-requisites that can
462 block an item from being enqueued. It can be considered a negative
463 version of **require**.
464
465 **approval**
466 This takes a list of approvals. If an approval matches the provided
467 criteria the change can not be entered into the pipeline. It follows
468 the same syntax as the :ref:`"require approval" pipeline above
469 <pipeline-require-approval>`.
470
471 Example to reject a change with any negative vote::
472
473 reject:
474 approval:
475 - code-review: [-1, -2]
476
James E. Blair2fa50962013-01-30 21:50:41 -0800477**dequeue-on-new-patchset**
478 Normally, if a new patchset is uploaded to a change that is in a
479 pipeline, the existing entry in the pipeline will be removed (with
480 jobs canceled and any dependent changes that can no longer merge as
481 well. To suppress this behavior (and allow jobs to continue
482 running), set this to ``false``. Default: ``true``.
483
James E. Blair17dd6772015-02-09 14:45:18 -0800484**ignore-dependencies**
485 In any kind of pipeline (dependent or independent), Zuul will
486 attempt to enqueue all dependencies ahead of the current change so
487 that they are tested together (independent pipelines report the
488 results of each change regardless of the results of changes ahead).
489 To ignore dependencies completely in an independent pipeline, set
490 this to ``true``. This option is ignored by dependent pipelines.
491 The default is: ``false``.
492
James E. Blaircdd00072012-06-08 19:17:28 -0700493**success**
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000494 Describes where Zuul should report to if all the jobs complete
495 successfully.
James E. Blaircdd00072012-06-08 19:17:28 -0700496 This section is optional; if it is omitted, Zuul will run jobs and
497 do nothing on success; it will not even report a message to Gerrit.
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000498 If the section is present, the listed reporter plugins will be
499 asked to report on the jobs.
Joshua Heskethfe485c62015-08-11 23:42:34 +1000500 The reporters are listed by their connection name. The options
501 available depend on the driver for the supplied connection.
502 See :doc:`reporters` for more details.
James E. Blaircdd00072012-06-08 19:17:28 -0700503
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400504**failure**
James E. Blaircdd00072012-06-08 19:17:28 -0700505 Uses the same syntax as **success**, but describes what Zuul should
506 do if at least one job fails.
James E. Blairdc253862012-06-13 17:12:42 -0700507
Joshua Heskethb7179772014-01-30 23:30:46 +1100508**merge-failure**
509 Uses the same syntax as **success**, but describes what Zuul should
510 do if it is unable to merge in the patchset. If no merge-failure
511 reporters are listed then the ``failure`` reporters will be used to
512 notify of unsuccessful merges.
513
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400514**start**
James E. Blairdc253862012-06-13 17:12:42 -0700515 Uses the same syntax as **success**, but describes what Zuul should
Clark Boylan00635dc2012-09-19 14:03:08 -0700516 do when a change is added to the pipeline manager. This can be used,
James E. Blairdc253862012-06-13 17:12:42 -0700517 for example, to reset the value of the Verified review category.
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400518
Joshua Hesketh89e829d2015-02-10 16:29:45 +1100519**disabled**
520 Uses the same syntax as **success**, but describes what Zuul should
521 do when a pipeline is disabled.
522 See ``disable-after-consecutive-failures``.
523
524**disable-after-consecutive-failures**
525 If set, a pipeline can enter a ''disabled'' state if too many changes
526 in a row fail. When this value is exceeded the pipeline will stop
527 reporting to any of the ``success``, ``failure`` or ``merge-failure``
528 reporters and instead only report to the ``disabled`` reporters.
529 (No ``start`` reports are made when a pipeline is disabled).
530
James E. Blair64ed6f22013-07-10 14:07:23 -0700531**precedence**
532 Indicates how the build scheduler should prioritize jobs for
533 different pipelines. Each pipeline may have one precedence, jobs
534 for pipelines with a higher precedence will be run before ones with
535 lower. The value should be one of ``high``, ``normal``, or ``low``.
536 Default: ``normal``.
537
Clark Boylanc2d19e42014-01-23 14:08:58 -0800538**window**
539 DependentPipelineManagers only. Zuul can rate limit
540 DependentPipelineManagers in a manner similar to TCP flow control.
541 Jobs are only started for changes in the queue if they sit in the
542 actionable window for the pipeline. The initial length of this window
543 is configurable with this value. The value given should be a positive
544 integer value. A value of ``0`` disables rate limiting on the
545 DependentPipelineManager.
546 Default: ``20``.
547
548**window-floor**
549 DependentPipelineManagers only. This is the minimum value for the
550 window described above. Should be a positive non zero integer value.
551 Default: ``3``.
552
553**window-increase-type**
554 DependentPipelineManagers only. This value describes how the window
555 should grow when changes are successfully merged by zuul. A value of
556 ``linear`` indicates that ``window-increase-factor`` should be added
557 to the previous window value. A value of ``exponential`` indicates
558 that ``window-increase-factor`` should be multiplied against the
559 previous window value and the result will become the window size.
560 Default: ``linear``.
561
562**window-increase-factor**
Clint Adams041ae512015-06-16 20:02:29 -0400563 DependentPipelineManagers only. The value to be added or multiplied
Clark Boylanc2d19e42014-01-23 14:08:58 -0800564 against the previous window value to determine the new window after
565 successful change merges.
566 Default: ``1``.
567
568**window-decrease-type**
569 DependentPipelineManagers only. This value describes how the window
570 should shrink when changes are not able to be merged by Zuul. A value
571 of ``linear`` indicates that ``window-decrease-factor`` should be
572 subtracted from the previous window value. A value of ``exponential``
573 indicates that ``window-decrease-factor`` should be divided against
574 the previous window value and the result will become the window size.
575 Default: ``exponential``.
576
577**window-decrease-factor**
578 DependentPipelineManagers only. The value to be subtracted or divided
579 against the previous window value to determine the new window after
580 unsuccessful change merges.
581 Default: ``2``.
582
Clark Boylan00635dc2012-09-19 14:03:08 -0700583Some example pipeline configurations are included in the sample layout
584file. The first is called a *check* pipeline::
James E. Blaircdd00072012-06-08 19:17:28 -0700585
586 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700587 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700588 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000589 my_gerrit:
590 - event: patchset-created
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: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700594 failure:
Thomas Bechtolda8c0dbd2015-12-10 07:16:54 +0100595 my_gerrit:
596 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700597
598This will trigger jobs each time a new patchset (or change) is
599uploaded to Gerrit, and report +/-1 values to Gerrit in the
600``verified`` review category. ::
601
602 - name: gate
Clark Boylan00635dc2012-09-19 14:03:08 -0700603 manager: DependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700604 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000605 my_gerrit:
606 - event: comment-added
607 approval:
608 - approved: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700609 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000610 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000611 verified: 2
612 submit: true
James E. Blaircdd00072012-06-08 19:17:28 -0700613 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000614 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000615 verified: -2
James E. Blaircdd00072012-06-08 19:17:28 -0700616
617This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the
618``approved`` review category in Gerrit (a non-standard category).
619Changes will be tested in such a way as to guarantee that they will be
620merged exactly as tested, though that will happen in parallel by
621creating a virtual queue of dependent changes and performing
622speculative execution of jobs. ::
623
624 - name: post
Clark Boylan00635dc2012-09-19 14:03:08 -0700625 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700626 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000627 my_gerrit:
628 - event: ref-updated
629 ref: ^(?!refs/).*$
James E. Blaircdd00072012-06-08 19:17:28 -0700630
631This will trigger jobs whenever a change is merged to a named branch
632(e.g., ``master``). No output will be reported to Gerrit. This is
633useful for side effects such as creating per-commit tarballs. ::
634
635 - name: silent
Clark Boylan00635dc2012-09-19 14:03:08 -0700636 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700637 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000638 my_gerrit:
639 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700640
641This also triggers jobs when changes are uploaded to Gerrit, but no
642results are reported to Gerrit. This is useful for jobs that are in
Antoine Mussoce333842012-10-16 14:42:35 +0200643development and not yet ready to be presented to developers. ::
644
645 pipelines:
646 - name: post-merge
647 manager: IndependentPipelineManager
648 trigger:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000649 my_gerrit:
650 - event: change-merged
Antoine Mussoce333842012-10-16 14:42:35 +0200651 success:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000652 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000653 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200654 failure:
Joshua Heskethfe485c62015-08-11 23:42:34 +1000655 my_gerrit:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000656 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200657
658The ``change-merged`` events happen when a change has been merged in the git
659repository. The change is thus closed and Gerrit will not accept modifications
660to the review scoring such as ``code-review`` or ``verified``. By using the
661``force-message: True`` parameter, Zuul will pass ``--force-message`` to the
662``gerrit review`` command, thus making sure the message is actually
663sent back to Gerrit regardless of approval scores.
664That kind of pipeline is nice to run regression or performance tests.
665
666.. note::
667 The ``change-merged`` event does not include the commit sha1 which can be
668 hazardous, it would let you report back to Gerrit though. If you were to
Michael Prokop526926a2013-10-24 16:16:57 +0200669 build a tarball for a specific commit, you should consider instead using
Łukasz Jernaś048acb42014-03-02 18:49:41 +0100670 the ``ref-updated`` event which does include the commit sha1 (but lacks the
Antoine Mussoce333842012-10-16 14:42:35 +0200671 Gerrit change number).
James E. Blaircdd00072012-06-08 19:17:28 -0700672
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100673
674.. _jobs:
675
James E. Blaircdd00072012-06-08 19:17:28 -0700676Jobs
677""""
678
679The jobs section is optional, and can be used to set attributes of
680jobs that are independent of their association with a project. For
681example, if a job should return a customized message on failure, that
682may be specified here. Otherwise, Zuul does not need to be told about
683each job as it builds a list from the project specification.
684
685**name**
686 The name of the job. This field is treated as a regular expression
687 and will be applied to each job that matches.
688
James E. Blairc8a1e052014-02-25 09:29:26 -0800689**queue-name (optional)**
690 Zuul will automatically combine projects that share a job into
691 shared change queues for dependent pipeline managers. In order to
692 report statistics about these queues, it is convenient for them to
693 have names. Zuul can automatically name change queues, however
694 these can grow quite long and are prone to changing as projects in
695 the queue change. If you assign a queue-name to a job, Zuul will
696 use that as the name for the shared change queue that contains that
697 job instead of the automatically generated one. It is an error for
698 a shared change queue to have more than one job with a queue-name if
699 they are not the same.
700
James E. Blaire5a847f2012-07-10 15:29:14 -0700701**failure-message (optional)**
702 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700703
James E. Blaire5a847f2012-07-10 15:29:14 -0700704**success-message (optional)**
705 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700706
James E. Blair6aea36d2012-12-17 13:03:24 -0800707**failure-pattern (optional)**
708 The URL that should be reported to Gerrit if the job fails.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700709 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800710 zuul.conf. May be supplied as a string pattern with substitutions
711 as described in url_pattern in :ref:`zuulconf`.
712
713**success-pattern (optional)**
714 The URL that should be reported to Gerrit if the job succeeds.
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
James E. Blair222d4982012-07-16 09:31:19 -0700719**hold-following-changes (optional)**
720 This is a boolean that indicates that changes that follow this
Clark Boylan00635dc2012-09-19 14:03:08 -0700721 change in a dependent change pipeline should wait until this job
James E. Blair222d4982012-07-16 09:31:19 -0700722 succeeds before launching. If this is applied to a very short job
723 that can predict whether longer jobs will fail early, this can be
724 used to reduce the number of jobs that Zuul will launch and
725 ultimately have to cancel. In that case, a small amount of
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400726 parallelization of jobs is traded for more efficient use of testing
James E. Blair222d4982012-07-16 09:31:19 -0700727 resources. On the other hand, to apply this to a long running job
728 would largely defeat the parallelization of dependent change testing
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400729 that is the main feature of Zuul. Default: ``false``.
James E. Blair222d4982012-07-16 09:31:19 -0700730
James E. Blairaf17a972016-02-03 15:07:18 -0800731**mutex (optional)**
732 This is a string that names a mutex that should be observed by this
733 job. Only one build of any job that references the same named mutex
734 will be enqueued at a time. This applies across all pipelines.
735
James E. Blaire5a847f2012-07-10 15:29:14 -0700736**branch (optional)**
James E. Blaircdd00072012-06-08 19:17:28 -0700737 This job should only be run on matching branches. This field is
738 treated as a regular expression and multiple branches may be
739 listed.
740
James E. Blair70c71582013-03-06 08:50:50 -0800741**files (optional)**
742 This job should only be run if at least one of the files involved in
743 the change (added, deleted, or modified) matches at least one of the
744 file patterns listed here. This field is treated as a regular
745 expression and multiple expressions may be listed.
746
Maru Newby3fe5f852015-01-13 04:22:14 +0000747**skip-if (optional)**
748
749 This job should not be run if all the patterns specified by the
750 optional fields listed below match on their targets. When multiple
751 sets of parameters are provided, this job will be skipped if any set
752 matches. For example: ::
753
754 jobs:
755 - name: check-tempest-dsvm-neutron
756 skip-if:
757 - project: ^openstack/neutron$
758 branch: ^stable/juno$
759 all-files-match-any:
760 - ^neutron/tests/.*$
761 - ^tools/.*$
762 - all-files-match-any:
763 - ^doc/.*$
764 - ^.*\.rst$
765
766 With this configuration, the job would be skipped for a neutron
767 patchset for the stable/juno branch provided that every file in the
768 change matched at least one of the specified file regexes. The job
769 will also be skipped for any patchset that modified only the doc
770 tree or rst files.
771
772 *project* (optional)
773 The regular expression to match against the project of the change.
774
775 *branch* (optional)
776 The regular expression to match against the branch or ref of the
777 change.
778
779 *all-files-match-any* (optional)
780 A list of regular expressions intended to match the files involved
781 in the change. This parameter will be considered matching a
782 change only if all files in a change match at least one of these
783 expressions.
784
785 The pattern for '/COMMIT_MSG' is always matched on and does not
Alexander Evseevdbe6fab2015-11-19 12:46:34 +0300786 have to be included. Exception is merge commits (without modified
787 files), in this case '/COMMIT_MSG' is not matched, and job is not
788 skipped. In case of merge commits it's assumed that list of modified
789 files isn't predictible and CI should be run.
Maru Newby3fe5f852015-01-13 04:22:14 +0000790
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400791**voting (optional)**
792 Boolean value (``true`` or ``false``) that indicates whatever
793 a job is voting or not. Default: ``true``.
794
James E. Blair456f2fb2016-02-09 09:29:33 -0800795**tags (optional)**
796 A list of arbitrary strings which will be associated with the job.
797 Can be used by the parameter-function to alter behavior based on
798 their presence on a job. If the job name is a regular expression,
799 tags will accumulate on jobs that match.
800
James E. Blaire5a847f2012-07-10 15:29:14 -0700801**parameter-function (optional)**
802 Specifies a function that should be applied to the parameters before
803 the job is launched. The function should be defined in a python file
804 included with the :ref:`includes` directive. The function
805 should have the following signature:
806
James E. Blaird0470972013-07-29 10:05:43 -0700807 .. function:: parameters(item, job, parameters)
James E. Blaire5a847f2012-07-10 15:29:14 -0700808
809 Manipulate the parameters passed to a job before a build is
810 launched. The ``parameters`` dictionary will already contain the
811 standard Zuul job parameters, and is expected to be modified
812 in-place.
813
James E. Blaird78576a2013-07-09 10:39:17 -0700814 :param item: the current queue item
815 :type item: zuul.model.QueueItem
James E. Blaird0470972013-07-29 10:05:43 -0700816 :param job: the job about to be run
817 :type job: zuul.model.Job
James E. Blaire5a847f2012-07-10 15:29:14 -0700818 :param parameters: parameters to be passed to the job
819 :type parameters: dict
820
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700821 If the parameter **ZUUL_NODE** is set by this function, then it will
822 be used to specify on what node (or class of node) the job should be
823 run.
824
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100825**swift**
826 If :ref:`swift` is configured then each job can define a destination
827 container for the builder to place logs and/or assets into. Multiple
828 containers can be listed for each job by providing a unique ``name``.
829
830 *name*
831 Set an identifying name for the container. This is used in the
832 parameter key sent to the builder. For example if it ``logs`` then
833 one of the parameters sent will be ``SWIFT_logs_CONTAINER``
834 (case-sensitive).
835
836 Each of the defaults defined in :ref:`swift` can be overwritten as:
837
838 *container* (optional)
839 Container name to place the log into
840 ``For example, logs``
841
842 *expiry* (optional)
843 How long the signed destination should be available for
844
James E. Blaird6500232014-06-23 15:05:48 -0700845 *max-file-size** (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100846 The maximum size of an individual file
847
James E. Blaird6500232014-06-23 15:05:48 -0700848 *max_file_size** (optional, deprecated)
849 A deprecated alternate spelling of *max-file-size*.
850
851 *max-file-count* (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100852 The maximum number of separate files to allow
853
James E. Blaird6500232014-06-23 15:05:48 -0700854 *max_file_count* (optional, deprecated)
855 A deprecated alternate spelling of *max-file-count*.
856
857 *logserver-prefix*
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100858 Provide a URL to the CDN or logserver app so that a worker knows
859 what URL to return.
860 ``For example: http://logs.example.org/server.app?obj=``
James E. Blaird6500232014-06-23 15:05:48 -0700861 The worker should return the logserver-prefix url and the object
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100862 path as the URL in the results data packet.
863
James E. Blaird6500232014-06-23 15:05:48 -0700864 *logserver_prefix* (deprecated)
865 A deprecated alternate spelling of *logserver-prefix*.
866
James E. Blaircdd00072012-06-08 19:17:28 -0700867Here is an example of setting the failure message for jobs that check
868whether a change merges cleanly::
869
870 - name: ^.*-merge$
Jeremy Stanley1c2c3c22015-06-15 21:23:19 +0000871 failure-message: This change or one of its cross-repo dependencies
872 was unable to be automatically merged with the current state of
873 its repository. Please rebase the change and upload a new
874 patchset.
James E. Blaircdd00072012-06-08 19:17:28 -0700875
876Projects
877""""""""
878
Clark Boylan00635dc2012-09-19 14:03:08 -0700879The projects section indicates what jobs should be run in each pipeline
James E. Blaircdd00072012-06-08 19:17:28 -0700880for events associated with each project. It contains a list of
881projects. Here is an example::
882
883 - name: example/project
884 check:
885 - project-merge:
886 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700887 - project-pep8
888 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700889 gate:
890 - project-merge:
891 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700892 - project-pep8
893 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700894 post:
895 - project-publish
896
897**name**
898 The name of the project (as known by Gerrit).
899
James E. Blair19deff22013-08-25 13:17:35 -0700900**merge-mode (optional)**
901 An optional value that indicates what strategy should be used to
902 merge changes to this project. Supported values are:
903
904 ** merge-resolve **
905 Equivalent to 'git merge -s resolve'. This corresponds closely to
906 what Gerrit performs (using JGit) for a project if the "Merge if
907 necessary" merge mode is selected and "Automatically resolve
908 conflicts" is checked. This is the default.
909
910 ** merge **
911 Equivalent to 'git merge'.
912
913 ** cherry-pick **
914 Equivalent to 'git cherry-pick'.
915
Clark Boylan00635dc2012-09-19 14:03:08 -0700916This is followed by a section for each of the pipelines defined above.
917Pipelines may be omitted if no jobs should run for this project in a
918given pipeline. Within the pipeline section, the jobs that should be
James E. Blaircdd00072012-06-08 19:17:28 -0700919executed are listed. If a job is entered as a dictionary key, then
920jobs contained within that key are only executed if the key job
921succeeds. In the above example, project-unittest, project-pep8, and
922project-pyflakes are only executed if project-merge succeeds. This
923can help avoid running unnecessary jobs.
924
James E. Blair18c64442014-03-18 10:14:45 -0700925The special job named ``noop`` is internal to Zuul and will always
926return ``SUCCESS`` immediately. This can be useful if you require
927that all changes be processed by a pipeline but a project has no jobs
928that can be run on it.
929
Andreas Jaegerbcfbf932014-09-29 20:21:44 +0200930.. 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 -0700931
Antoine Musso80edd5a2013-02-13 15:37:53 +0100932Project Templates
933"""""""""""""""""
934
Michael Prokop526926a2013-10-24 16:16:57 +0200935Whenever you have lot of similar projects (such as plugins for a project) you
Antoine Musso80edd5a2013-02-13 15:37:53 +0100936will most probably want to use the same pipeline configurations. The
937project templates let you define pipelines and job name templates to trigger.
938One can then just apply the template on its project which make it easier to
Michael Prokop526926a2013-10-24 16:16:57 +0200939update several similar projects. As an example::
Antoine Musso80edd5a2013-02-13 15:37:53 +0100940
941 project-templates:
942 # Name of the template
943 - name: plugin-triggering
944 # Definition of pipelines just like for a `project`
945 check:
946 - '{jobprefix}-merge':
947 - '{jobprefix}-pep8'
948 - '{jobprefix}-pyflakes'
949 gate:
950 - '{jobprefix}-merge':
951 - '{jobprefix}-unittest'
952 - '{jobprefix}-pep8'
953 - '{jobprefix}-pyflakes'
954
955In your projects definition, you will then apply the template using the template
956key::
957
958 projects:
959 - name: plugin/foobar
960 template:
961 - name: plugin-triggering
962 jobprefix: plugin-foobar
963
James E. Blairaea6cf62013-12-16 15:38:12 -0800964You can pass several parameters to a template. A ``parameter`` value
965will be used for expansion of ``{parameter}`` in the template
966strings. The parameter ``name`` will be automatically provided and
967will contain the short name of the project, that is the portion of the
968project name after the last ``/`` character.
James E. Blaircdd00072012-06-08 19:17:28 -0700969
James E. Blair3e98c022013-12-16 15:25:38 -0800970Multiple templates can be combined in a project, and the jobs from all
971of those templates will be added to the project. Individual jobs may
972also be added::
973
974 projects:
975 - name: plugin/foobar
976 template:
977 - name: plugin-triggering
978 jobprefix: plugin-foobar
979 - name: plugin-extras
980 jobprefix: plugin-foobar
981 check:
982 - foobar-extra-special-job
983
Steven Dake21ef9ad2014-08-25 23:08:14 -0700984Individual jobs may optionally be added to pipelines (e.g. check,
Atsushi SAKAI5d7e93b2015-07-28 22:15:48 +0900985gate, et cetera) for a project, in addition to those provided by
Steven Dake21ef9ad2014-08-25 23:08:14 -0700986templates.
987
James E. Blair3e98c022013-12-16 15:25:38 -0800988The order of the jobs listed in the project (which only affects the
989order of jobs listed on the report) will be the jobs from each
990template in the order listed, followed by any jobs individually listed
991for the project.
992
993Note that if multiple templates are used for a project and one
994template specifies a job that is also specified in another template,
James E. Blair12a92b12014-03-26 11:54:53 -0700995or specified in the project itself, the configuration defined by
996either the last template or the project itself will take priority.
James E. Blair3e98c022013-12-16 15:25:38 -0800997
James E. Blaircdd00072012-06-08 19:17:28 -0700998logging.conf
999~~~~~~~~~~~~
1000This file is optional. If provided, it should be a standard
1001:mod:`logging.config` module configuration file. If not present, Zuul will
1002output all log messages of DEBUG level or higher to the console.
1003
1004Starting Zuul
1005-------------
1006
1007To start Zuul, run **zuul-server**::
1008
Antoine Mussob3aa8282013-04-19 15:16:59 +02001009 usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version]
James E. Blaircdd00072012-06-08 19:17:28 -07001010
1011 Project gating system.
1012
1013 optional arguments:
1014 -h, --help show this help message and exit
1015 -c CONFIG specify the config file
Antoine Mussob3aa8282013-04-19 15:16:59 +02001016 -l LAYOUT specify the layout file
James E. Blaircdd00072012-06-08 19:17:28 -07001017 -d do not run as a daemon
Antoine Mussob3aa8282013-04-19 15:16:59 +02001018 -t validate layout file syntax
1019 --version show zuul version
James E. Blaircdd00072012-06-08 19:17:28 -07001020
1021You may want to use the ``-d`` argument while you are initially setting
1022up Zuul so you can detect any configuration errors quickly. Under
1023normal operation, omit ``-d`` and let Zuul run as a daemon.
1024
1025If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will
1026stop executing new jobs, wait until all executing jobs are finished,
Joshua Heskethc4997152016-02-17 21:04:18 +11001027reload its layout.yaml, and resume. Changes to any connections or
1028the PID file will be ignored until Zuul is restarted.
Clark Boylanf231fa22013-02-08 12:28:53 -08001029
1030If you send a SIGUSR1 to the zuul-server process, Zuul will stop
1031executing new jobs, wait until all executing jobs are finished,
1032then exit. While waiting to exit Zuul will queue Gerrit events and
1033save these events prior to exiting. When Zuul starts again it will
1034read these saved events and act on them.
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001035
Michael Prokop526926a2013-10-24 16:16:57 +02001036If you need to abort Zuul and intend to manually requeue changes for
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001037jobs which were running in its pipelines, prior to terminating you can
1038use the zuul-changes.py tool script to simplify the process. For
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001039example, this would give you a list of zuul-enqueue commands to requeue
1040changes for the gate and check pipelines respectively::
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001041
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001042 ./tools/zuul-changes.py http://zuul.openstack.org/ gate
1043 ./tools/zuul-changes.py http://zuul.openstack.org/ check
Clark Boylanfba9b242013-08-20 10:11:17 -07001044
Antoine Musso29eab012014-10-28 21:35:22 +01001045If you send a SIGUSR2 to the zuul-server process, or the forked process
1046that runs the Gearman daemon, Zuul will dump a stack trace for each
1047running thread into its debug log. It is written under the log bucket
1048``zuul.stack_dump``. This is useful for tracking down deadlock or
1049otherwise slow threads.
Antoine Mussod0f06262014-06-04 09:54:24 +02001050
1051When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python
1052Profiler) is available, additional functions' and threads' stats are
1053emitted as well. The first SIGUSR2 will enable yappi, on the second
1054SIGUSR2 it dumps the information collected, resets all yappi state and
1055stops profiling. This is to minimize the impact of yappi on a running
1056system.