blob: bcdfabbf746aaf4b6b4fe6044578108e1295ec36 [file] [log] [blame]
James E. Blaircdd00072012-06-08 19:17:28 -07001:title: Zuul
2
3Zuul
4====
5
6Configuration
7-------------
8
9Zuul has three configuration files:
10
11**zuul.conf**
James E. Blair1f4c2bb2013-04-26 08:40:46 -070012 Connection information for Gerrit and Gearman, locations of the
Łukasz Jernaś048acb42014-03-02 18:49:41 +010013 other config files.
James E. Blaircdd00072012-06-08 19:17:28 -070014**layout.yaml**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010015 Project and pipeline configuration -- what Zuul does.
James E. Blaircdd00072012-06-08 19:17:28 -070016**logging.conf**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010017 Python logging config.
James E. Blaircdd00072012-06-08 19:17:28 -070018
19Examples of each of the three files can be found in the etc/ directory
20of the source distribution.
21
James E. Blair6aea36d2012-12-17 13:03:24 -080022.. _zuulconf:
23
James E. Blaircdd00072012-06-08 19:17:28 -070024zuul.conf
25~~~~~~~~~
26
27Zuul will look for ``/etc/zuul/zuul.conf`` or ``~/zuul.conf`` to
28bootstrap its configuration. Alternately, you may specify ``-c
29/path/to/zuul.conf`` on the command line.
30
James E. Blair1f4c2bb2013-04-26 08:40:46 -070031Gerrit and Gearman connection information are each described in a
32section of zuul.conf. The location of the other two configuration
33files (as well as the location of the PID file when running Zuul as a
34server) are specified in a third section.
James E. Blaircdd00072012-06-08 19:17:28 -070035
Clark Boylan9b670902012-09-28 13:47:56 -070036The three sections of this config and their options are documented below.
37You can also find an example zuul.conf file in the git
38`repository
Andreas Jaegerbcfbf932014-09-29 20:21:44 +020039<https://git.openstack.org/cgit/openstack-infra/zuul/tree/etc/zuul.conf-sample>`_
Clark Boylan9b670902012-09-28 13:47:56 -070040
James E. Blair1f4c2bb2013-04-26 08:40:46 -070041gearman
Clark Boylan9b670902012-09-28 13:47:56 -070042"""""""
43
44**server**
James E. Blair1f4c2bb2013-04-26 08:40:46 -070045 Hostname or IP address of the Gearman server.
46 ``server=gearman.example.com``
Clark Boylan9b670902012-09-28 13:47:56 -070047
James E. Blair1f4c2bb2013-04-26 08:40:46 -070048**port**
Łukasz Jernaś048acb42014-03-02 18:49:41 +010049 Port on which the Gearman server is listening.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070050 ``port=4730``
Clark Boylan9b670902012-09-28 13:47:56 -070051
James E. Blair77cc7b82013-07-15 13:22:37 -070052gearman_server
53""""""""""""""
54
55**start**
56 Whether to start the internal Gearman server (default: False).
57 ``start=true``
58
James E. Blair0ac452e2015-07-22 09:05:16 -070059**listen_address**
60 IP address or domain name on which to listen (default: all addresses).
61 ``listen_address=127.0.0.1``
62
James E. Blair77cc7b82013-07-15 13:22:37 -070063**log_config**
64 Path to log config file for internal Gearman server.
65 ``log_config=/etc/zuul/gearman-logging.yaml``
66
Clark Boylan9b670902012-09-28 13:47:56 -070067gerrit
68""""""
69
70**server**
71 FQDN of Gerrit server.
72 ``server=review.example.com``
73
Akihiro Motokic7d28a72014-03-22 09:21:38 +090074**port**
75 Optional: Gerrit server port.
76 ``port=29418``
77
Antoine Musso27475012012-11-26 09:53:01 +010078**baseurl**
79 Optional: path to Gerrit web interface. Defaults to ``https://<value
80 of server>/``. ``baseurl=https://review.example.com/review_site/``
81
Clark Boylan9b670902012-09-28 13:47:56 -070082**user**
83 User name to use when logging into above server via ssh.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070084 ``user=zuul``
Clark Boylan9b670902012-09-28 13:47:56 -070085
86**sshkey**
87 Path to SSH key to use when logging into above server.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070088 ``sshkey=/home/zuul/.ssh/id_rsa``
Clark Boylan9b670902012-09-28 13:47:56 -070089
90zuul
91""""
92
Antoine Musso9adc6d42014-11-14 15:37:48 +010093.. _layout_config:
94
Clark Boylan9b670902012-09-28 13:47:56 -070095**layout_config**
James E. Blair4076e2b2014-01-28 12:42:20 -080096 Path to layout config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -070097 ``layout_config=/etc/zuul/layout.yaml``
98
99**log_config**
James E. Blaira4430132014-02-17 08:32:07 -0800100 Path to log config file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700101 ``log_config=/etc/zuul/logging.yaml``
102
103**pidfile**
James E. Blaira4430132014-02-17 08:32:07 -0800104 Path to PID lock file. Used by zuul-server only.
Clark Boylan9b670902012-09-28 13:47:56 -0700105 ``pidfile=/var/run/zuul/zuul.pid``
106
107**state_dir**
James E. Blair4076e2b2014-01-28 12:42:20 -0800108 Path to directory that Zuul should save state to. Used by all Zuul
109 commands.
Clark Boylan9b670902012-09-28 13:47:56 -0700110 ``state_dir=/var/lib/zuul``
111
James E. Blair4076e2b2014-01-28 12:42:20 -0800112**report_times**
113 Boolean value (``true`` or ``false``) that determines if Zuul should
114 include elapsed times for each job in the textual report. Used by
115 zuul-server only.
116 ``report_times=true``
117
118**status_url**
119 URL that will be posted in Zuul comments made to Gerrit changes when
120 starting jobs for a change. Used by zuul-server only.
121 ``status_url=https://zuul.example.com/status``
122
Clark Boylane0b4bdb2014-06-03 17:01:25 -0700123**status_expiry**
124 Zuul will cache the status.json file for this many seconds. This is an
125 optional value and ``1`` is used by default.
126 ``status_expiry=1``
127
James E. Blair4076e2b2014-01-28 12:42:20 -0800128**url_pattern**
129 If you are storing build logs external to the system that originally
130 ran jobs and wish to link to those logs when Zuul makes comments on
131 Gerrit changes for completed jobs this setting configures what the
132 URLs for those links should be. Used by zuul-server only.
133 ``http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}``
134
135**job_name_in_report**
136 Boolean value (``true`` or ``false``) that indicates whether the
137 job name should be included in the report (normally only the URL
138 is included). Defaults to ``false``. Used by zuul-server only.
139 ``job_name_in_report=true``
140
141merger
142""""""
143
Clark Boylan9b670902012-09-28 13:47:56 -0700144**git_dir**
145 Directory that Zuul should clone local git repositories to.
146 ``git_dir=/var/lib/zuul/git``
147
Paul Belangerb67aba12013-05-13 19:22:14 -0400148**git_user_email**
149 Optional: Value to pass to `git config user.email`.
150 ``git_user_email=zuul@example.com``
151
152**git_user_name**
153 Optional: Value to pass to `git config user.name`.
154 ``git_user_name=zuul``
155
Arx Cruzb1b010d2013-10-28 19:49:59 -0200156**zuul_url**
James E. Blair4076e2b2014-01-28 12:42:20 -0800157 URL of this merger's git repos, accessible to test workers. Usually
158 "http://zuul.example.com/p" or "http://zuul-merger01.example.com/p"
159 depending on whether the merger is co-located with the Zuul server.
Arx Cruzb1b010d2013-10-28 19:49:59 -0200160
James E. Blaira4430132014-02-17 08:32:07 -0800161**log_config**
162 Path to log config file for the merger process.
163 ``log_config=/etc/zuul/logging.yaml``
164
165**pidfile**
166 Path to PID lock file for the merger process.
167 ``pidfile=/var/run/zuul-merger/merger.pid``
168
Joshua Hesketh5fea8672013-08-19 17:32:01 +1000169smtp
170""""
171
172**server**
173 SMTP server hostname or address to use.
174 ``server=localhost``
175
Akihiro Motokic7d28a72014-03-22 09:21:38 +0900176**port**
177 Optional: SMTP server port.
178 ``port=25``
179
Joshua Hesketh5fea8672013-08-19 17:32:01 +1000180**default_from**
181 Who the email should appear to be sent from when emailing the report.
182 This can be overridden by individual pipelines.
183 ``default_from=zuul@example.com``
184
185**default_to**
186 Who the report should be emailed to by default.
187 This can be overridden by individual pipelines.
188 ``default_to=you@example.com``
189
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100190.. _swift:
191
192swift
193"""""
194
195To send (optional) swift upload instructions this section must be
Antoine Musso62fa2d42014-06-04 22:55:23 +0200196present. Multiple destinations can be defined in the :ref:`jobs` section
197of the layout.
198
199If you are sending the temp-url-key or fetching the x-storage-url, you
200will need the python-swiftclient module installed.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100201
Joshua Heskethc4967502014-05-15 06:39:14 -0700202**X-Account-Meta-Temp-Url-Key** (optional)
203 This is the key used to sign the HMAC message. If you do not set a
204 key Zuul will generate one automatically.
205
206**Send-Temp-Url-Key** (optional)
207 Zuul can send the X-Account-Meta-Temp-Url-Key to swift for you if
208 you have set up the appropriate credentials in ``authurl`` below.
209 This isn't necessary if you know and have set your
210 X-Account-Meta-Temp-Url-Key.
Antoine Musso62fa2d42014-06-04 22:55:23 +0200211 If set, Zuul requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700212 ``default: true``
213
214**X-Storage-Url** (optional)
215 The storage URL is the destination to upload files into. If you do
216 not set this the ``authurl`` credentials are used to fetch the url
Antoine Musso62fa2d42014-06-04 22:55:23 +0200217 from swift and Zuul will requires the python-swiftclient module.
Joshua Heskethc4967502014-05-15 06:39:14 -0700218
219**authurl** (optional)
220 The (keystone) Auth URL for swift.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100221 ``For example, https://identity.api.rackspacecloud.com/v2.0/``
Joshua Heskethc4967502014-05-15 06:39:14 -0700222 This is required if you have Send-Temp-Url-Key set to ``True`` or
223 if you have not supplied the X-Storage-Url.
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100224
225Any of the `swiftclient connection parameters`_ can also be defined
226here by the same name. Including the os_options by their key name (
227``for example tenant_id``)
228
229.. _swiftclient connection parameters: http://docs.openstack.org/developer/python-swiftclient/swiftclient.html#module-swiftclient.client
230
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100231**region_name** (optional)
232 The region name holding the swift container
233 ``For example, SYD``
234
235Each destination defined by the :ref:`jobs` will have the following
236default values that it may overwrite.
237
238**default_container** (optional)
239 Container name to place the log into
240 ``For example, logs``
241
242**default_expiry** (optional)
243 How long the signed destination should be available for
244 ``default: 7200 (2hrs)``
245
246**default_max_file_size** (optional)
247 The maximum size of an individual file
248 ``default: 104857600 (100MB)``
249
250**default_max_file_count** (optional)
251 The maximum number of separate files to allow
252 ``default: 10``
253
254**default_logserver_prefix**
255 Provide a URL to the CDN or logserver app so that a worker knows
256 what URL to return. The worker should return the logserver_prefix
257 url and the object path.
258 ``For example: http://logs.example.org/server.app?obj=``
259
James E. Blaircdd00072012-06-08 19:17:28 -0700260layout.yaml
261~~~~~~~~~~~
262
Clark Boylan00635dc2012-09-19 14:03:08 -0700263This is the main configuration file for Zuul, where all of the pipelines
James E. Blaircdd00072012-06-08 19:17:28 -0700264and projects are defined, what tests should be run, and what actions
Clark Boylan00635dc2012-09-19 14:03:08 -0700265Zuul should perform. There are three sections: pipelines, jobs, and
James E. Blaircdd00072012-06-08 19:17:28 -0700266projects.
267
James E. Blaire5a847f2012-07-10 15:29:14 -0700268.. _includes:
269
270Includes
271""""""""
272
273Custom functions to be used in Zuul's configuration may be provided
274using the ``includes`` directive. It accepts a list of files to
275include, and currently supports one type of inclusion, a python file::
276
277 includes:
278 - python-file: local_functions.py
279
280**python-file**
Antoine Musso9adc6d42014-11-14 15:37:48 +0100281 The path to a python file (either an absolute path or relative to the
282 directory name of :ref:`layout_config <layout_config>`). The
283 file will be loaded and objects that it defines will be placed in a
284 special environment which can be referenced in the Zuul configuration.
285 Currently only the parameter-function attribute of a Job uses this
286 feature.
James E. Blaire5a847f2012-07-10 15:29:14 -0700287
Clark Boylan00635dc2012-09-19 14:03:08 -0700288Pipelines
289"""""""""
James E. Blaircdd00072012-06-08 19:17:28 -0700290
Clark Boylan00635dc2012-09-19 14:03:08 -0700291Zuul can have any number of independent pipelines. Whenever a matching
292Gerrit event is found for a pipeline, that event is added to the
293pipeline, and the jobs specified for that pipeline are run. When all
294jobs specified for the pipeline that were triggered by an event are
295completed, Zuul reports back to Gerrit the results.
James E. Blaircdd00072012-06-08 19:17:28 -0700296
Clark Boylan00635dc2012-09-19 14:03:08 -0700297There are no pre-defined pipelines in Zuul, rather you can define
298whatever pipelines you need in the layout file. This is a very flexible
299system that can accommodate many kinds of workflows.
James E. Blaircdd00072012-06-08 19:17:28 -0700300
Clark Boylan00635dc2012-09-19 14:03:08 -0700301Here is a quick example of a pipeline definition followed by an
James E. Blaircdd00072012-06-08 19:17:28 -0700302explanation of each of the parameters::
303
304 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700305 manager: IndependentPipelineManager
James E. Blairc0dedf82014-08-06 09:37:52 -0700306 source: gerrit
James E. Blaircdd00072012-06-08 19:17:28 -0700307 trigger:
James E. Blair6c358e72013-07-29 17:06:47 -0700308 gerrit:
309 - event: patchset-created
James E. Blaircdd00072012-06-08 19:17:28 -0700310 success:
311 verified: 1
312 failure:
313 verified: -1
314
315**name**
316 This is used later in the project definition to indicate what jobs
Clark Boylan00635dc2012-09-19 14:03:08 -0700317 should be run for events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700318
James E. Blair8dbd56a2012-12-22 10:55:10 -0800319**description**
320 This is an optional field that may be used to provide a textual
321 description of the pipeline.
322
James E. Blairc0dedf82014-08-06 09:37:52 -0700323**source**
324 A required field that specifies a trigger that provides access to
325 the change objects that this pipeline operates on. Currently only
326 the value ``gerrit`` is supported.
327
James E. Blair56370192013-01-14 15:47:28 -0800328**success-message**
329 An optional field that supplies the introductory text in message
330 reported back to Gerrit when all the voting builds are successful.
331 Defaults to "Build successful."
332
333**failure-message**
334 An optional field that supplies the introductory text in message
335 reported back to Gerrit when at least one voting build fails.
336 Defaults to "Build failed."
337
Joshua Heskethb7179772014-01-30 23:30:46 +1100338**merge-failure-message**
339 An optional field that supplies the introductory text in message
340 reported back to Gerrit when a change fails to merge with the
341 current state of the repository.
342 Defaults to "Merge failed."
343
Joshua Hesketh3979e3e2014-03-04 11:21:10 +1100344**footer-message**
345 An optional field to supply additional information after test results.
346 Useful for adding information about the CI system such as debugging
347 and contact details.
348
James E. Blaircdd00072012-06-08 19:17:28 -0700349**manager**
Clark Boylan00635dc2012-09-19 14:03:08 -0700350 There are currently two schemes for managing pipelines:
James E. Blaircdd00072012-06-08 19:17:28 -0700351
Clark Boylan00635dc2012-09-19 14:03:08 -0700352 *IndependentPipelineManager*
353 Every event in this pipeline should be treated as independent of
354 other events in the pipeline. This is appropriate when the order of
355 events in the pipeline doesn't matter because the results of the
356 actions this pipeline performs can not affect other events in the
357 pipeline. For example, when a change is first uploaded for review,
James E. Blaircdd00072012-06-08 19:17:28 -0700358 you may want to run tests on that change to provide early feedback
359 to reviewers. At the end of the tests, the change is not going to
360 be merged, so it is safe to run these tests in parallel without
Clark Boylan00635dc2012-09-19 14:03:08 -0700361 regard to any other changes in the pipeline. They are independent.
James E. Blaircdd00072012-06-08 19:17:28 -0700362
Clark Boylan00635dc2012-09-19 14:03:08 -0700363 Another type of pipeline that is independent is a post-merge
364 pipeline. In that case, the changes have already merged, so the
365 results can not affect any other events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700366
Clark Boylan00635dc2012-09-19 14:03:08 -0700367 *DependentPipelineManager*
368 The dependent pipeline manager is designed for gating. It ensures
James E. Blaircdd00072012-06-08 19:17:28 -0700369 that every change is tested exactly as it is going to be merged
370 into the repository. An ideal gating system would test one change
371 at a time, applied to the tip of the repository, and only if that
372 change passed tests would it be merged. Then the next change in
373 line would be tested the same way. In order to achieve parallel
Clark Boylan00635dc2012-09-19 14:03:08 -0700374 testing of changes, the dependent pipeline manager performs
James E. Blaircdd00072012-06-08 19:17:28 -0700375 speculative execution on changes. It orders changes based on
Clark Boylan00635dc2012-09-19 14:03:08 -0700376 their entry into the pipeline. It begins testing all changes in
377 parallel, assuming that each change ahead in the pipeline will pass
James E. Blaircdd00072012-06-08 19:17:28 -0700378 its tests. If they all succeed, all the changes can be tested and
Clark Boylan00635dc2012-09-19 14:03:08 -0700379 merged in parallel. If a change near the front of the pipeline
380 fails its tests, each change behind it ignores whatever tests have
381 been completed and are tested again without the change in front.
382 This way gate tests may run in parallel but still be tested
383 correctly, exactly as they will appear in the repository when
384 merged.
James E. Blaircdd00072012-06-08 19:17:28 -0700385
Clark Boylan00635dc2012-09-19 14:03:08 -0700386 One important characteristic of the DependentPipelineManager is that
James E. Blaircdd00072012-06-08 19:17:28 -0700387 it analyzes the jobs that are triggered by different projects, and
388 if those projects have jobs in common, it treats those projects as
389 related, and they share a single virtual queue of changes. Thus,
390 if there is a job that performs integration testing on two
391 projects, those two projects will automatically share a virtual
392 change queue. If a third project does not invoke that job, it
Clark Boylan00635dc2012-09-19 14:03:08 -0700393 will be part of a separate virtual change queue, and changes to
394 it will not depend on changes to the first two jobs.
James E. Blaircdd00072012-06-08 19:17:28 -0700395
396 For more detail on the theory and operation of Zuul's
Clark Boylan00635dc2012-09-19 14:03:08 -0700397 DependentPipelineManager, see: :doc:`gating`.
James E. Blaircdd00072012-06-08 19:17:28 -0700398
399**trigger**
James E. Blairc494d542014-08-06 09:23:52 -0700400 At least one trigger source must be supplied for each pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700401 Triggers are not exclusive -- matching events may be placed in
James E. Blair6c358e72013-07-29 17:06:47 -0700402 multiple pipelines, and they will behave independently in each of
403 the pipelines they match. You may select from the following:
James E. Blaircdd00072012-06-08 19:17:28 -0700404
James E. Blair6c358e72013-07-29 17:06:47 -0700405 **gerrit**
406 This describes what Gerrit events should be placed in the
407 pipeline. Multiple gerrit triggers may be listed. Further
408 parameters describe the kind of events that match:
James E. Blaircdd00072012-06-08 19:17:28 -0700409
James E. Blair6c358e72013-07-29 17:06:47 -0700410 *event*
411 The event name from gerrit. Examples: ``patchset-created``,
412 ``comment-added``, ``ref-updated``. This field is treated as a
413 regular expression.
James E. Blaircdd00072012-06-08 19:17:28 -0700414
James E. Blair6c358e72013-07-29 17:06:47 -0700415 *branch*
416 The branch associated with the event. Example: ``master``. This
417 field is treated as a regular expression, and multiple branches may
418 be listed.
James E. Blaircdd00072012-06-08 19:17:28 -0700419
James E. Blair6c358e72013-07-29 17:06:47 -0700420 *ref*
421 On ref-updated events, the branch parameter is not used, instead the
422 ref is provided. Currently Gerrit has the somewhat idiosyncratic
423 behavior of specifying bare refs for branch names (e.g., ``master``),
424 but full ref names for other kinds of refs (e.g., ``refs/tags/foo``).
425 Zuul matches what you put here exactly against what Gerrit
426 provides. This field is treated as a regular expression, and
427 multiple refs may be listed.
James E. Blaircdd00072012-06-08 19:17:28 -0700428
James E. Blair6c358e72013-07-29 17:06:47 -0700429 *approval*
430 This is only used for ``comment-added`` events. It only matches if
431 the event has a matching approval associated with it. Example:
432 ``code-review: 2`` matches a ``+2`` vote on the code review category.
433 Multiple approvals may be listed.
Antoine Mussob4e809e2012-12-06 16:58:06 +0100434
James E. Blair1fbfceb2014-06-23 14:42:53 -0700435 *email*
James E. Blair6c358e72013-07-29 17:06:47 -0700436 This is used for any event. It takes a regex applied on the performer
Michael Prokop526926a2013-10-24 16:16:57 +0200437 email, i.e. Gerrit account email address. If you want to specify
James E. Blair6c358e72013-07-29 17:06:47 -0700438 several email filters, you must use a YAML list. Make sure to use non
439 greedy matchers and to escapes dots!
James E. Blair1fbfceb2014-06-23 14:42:53 -0700440 Example: ``email: ^.*?@example\.org$``.
James E. Blair6c358e72013-07-29 17:06:47 -0700441
James E. Blair1fbfceb2014-06-23 14:42:53 -0700442 *email_filter* (deprecated)
443 A deprecated alternate spelling of *email*. Only one of *email* or
444 *email_filter* should be used.
445
446 *username*
Joshua Heskethb8a817e2013-12-27 11:21:38 +1100447 This is used for any event. It takes a regex applied on the performer
448 username, i.e. Gerrit account name. If you want to specify several
449 username filters, you must use a YAML list. Make sure to use non greedy
450 matchers and to escapes dots!
James E. Blair1fbfceb2014-06-23 14:42:53 -0700451 Example: ``username: ^jenkins$``.
Joshua Heskethb8a817e2013-12-27 11:21:38 +1100452
James E. Blair1fbfceb2014-06-23 14:42:53 -0700453 *username_filter* (deprecated)
454 A deprecated alternate spelling of *username*. Only one of *username* or
455 *username_filter* should be used.
456
457 *comment*
James E. Blair6c358e72013-07-29 17:06:47 -0700458 This is only used for ``comment-added`` events. It accepts a list of
459 regexes that are searched for in the comment string. If any of these
460 regexes matches a portion of the comment string the trigger is
James E. Blair1fbfceb2014-06-23 14:42:53 -0700461 matched. ``comment: retrigger`` will match when comments
James E. Blair6c358e72013-07-29 17:06:47 -0700462 containing 'retrigger' somewhere in the comment text are added to a
463 change.
Clark Boylanb9bcb402012-06-29 17:44:05 -0700464
James E. Blair1fbfceb2014-06-23 14:42:53 -0700465 *comment_filter* (deprecated)
466 A deprecated alternate spelling of *comment*. Only one of *comment* or
467 *comment_filter* should be used.
468
James E. Blair5bf78a32015-07-30 18:08:24 +0000469 *require-approval*
James E. Blairc053d022014-01-22 14:57:33 -0800470 This may be used for any event. It requires that a certain kind
471 of approval be present for the current patchset of the change (the
James E. Blair11041d22014-05-02 14:49:53 -0700472 approval could be added by the event in question). It follows the
Antoine Musso27ab0d52014-10-22 14:20:17 +0200473 same syntax as the :ref:`"approval" pipeline requirement below
474 <pipeline-require-approval>`.
James E. Blairc053d022014-01-22 14:57:33 -0800475
James E. Blair63bb0ef2013-07-29 17:14:51 -0700476 **timer**
477 This trigger will run based on a cron-style time specification.
478 It will enqueue an event into its pipeline for every project
479 defined in the configuration. Any job associated with the
480 pipeline will run in response to that event.
481
482 *time*
483 The time specification in cron syntax. Only the 5 part syntax is
484 supported, not the symbolic names. Example: ``0 0 * * *`` runs
485 at midnight.
486
James E. Blairc494d542014-08-06 09:23:52 -0700487 **zuul**
488 This trigger supplies events generated internally by Zuul.
489 Multiple events may be listed.
490
491 *event*
492 The event name. Currently supported:
493
494 *project-change-merged* when Zuul merges a change to a project,
495 it generates this event for every open change in the project.
496
497 *parent-change-enqueued* when Zuul enqueues a change into any
498 pipeline, it generates this event for every child of that
499 change.
500
501 *pipeline*
502 Only available for ``parent-change-enqueued`` events. This is the
503 name of the pipeline in which the parent change was enqueued.
504
505 *require-approval*
506 This may be used for any event. It requires that a certain kind
507 of approval be present for the current patchset of the change (the
508 approval could be added by the event in question). It follows the
Antoine Musso27ab0d52014-10-22 14:20:17 +0200509 same syntax as the :ref:`"approval" pipeline requirement below
510 <pipeline-require-approval>`.
James E. Blairc494d542014-08-06 09:23:52 -0700511
512
James E. Blair11041d22014-05-02 14:49:53 -0700513**require**
514 If this section is present, it established pre-requisites for any
515 kind of item entering the Pipeline. Regardless of how the item is
516 to be enqueued (via any trigger or automatic dependency resolution),
517 the conditions specified here must be met or the item will not be
518 enqueued.
519
Antoine Musso27ab0d52014-10-22 14:20:17 +0200520.. _pipeline-require-approval:
521
James E. Blair5bf78a32015-07-30 18:08:24 +0000522 **approval**
James E. Blair11041d22014-05-02 14:49:53 -0700523 This requires that a certain kind of approval be present for the
524 current patchset of the change (the approval could be added by the
525 event in question). It takes several sub-parameters, all of which
526 are optional and are combined together so that there must be an
527 approval matching all specified requirements.
528
529 *username*
530 If present, an approval from this username is required.
531
James E. Blair1fbfceb2014-06-23 14:42:53 -0700532 *email*
James E. Blair11041d22014-05-02 14:49:53 -0700533 If present, an approval with this email address is required. It
534 is treated as a regular expression as above.
535
James E. Blair1fbfceb2014-06-23 14:42:53 -0700536 *email-filter* (deprecated)
537 A deprecated alternate spelling of *email*. Only one of *email* or
538 *email_filter* should be used.
539
James E. Blair11041d22014-05-02 14:49:53 -0700540 *older-than*
541 If present, the approval must be older than this amount of time
542 to match. Provide a time interval as a number with a suffix of
543 "w" (weeks), "d" (days), "h" (hours), "m" (minutes), "s"
544 (seconds). Example ``48h`` or ``2d``.
545
546 *newer-than*
547 If present, the approval must be newer than this amount of time
548 to match. Same format as "older-than".
549
550 Any other field is interpreted as a review category and value
551 pair. For example ``verified: 1`` would require that the approval
James E. Blair9c17dbf2014-06-23 14:21:58 -0700552 be for a +1 vote in the "Verified" column. The value may either
553 be a single value or a list: ``verified: [1, 2]`` would match
554 either a +1 or +2 vote.
James E. Blair11041d22014-05-02 14:49:53 -0700555
556 **open**
557 A boolean value (``true`` or ``false``) that indicates whether the change
558 must be open or closed in order to be enqueued.
559
Clark Boylana9702ad2014-05-08 17:17:24 -0700560 **current-patchset**
561 A boolean value (``true`` or ``false``) that indicates whether the change
562 must be the current patchset in order to be enqueued.
563
James E. Blair11041d22014-05-02 14:49:53 -0700564 **status**
565 A string value that corresponds with the status of the change
566 reported by the trigger. For example, when using the Gerrit
567 trigger, status values such as ``NEW`` or ``MERGED`` may be useful.
James E. Blair63bb0ef2013-07-29 17:14:51 -0700568
James E. Blair2fa50962013-01-30 21:50:41 -0800569**dequeue-on-new-patchset**
570 Normally, if a new patchset is uploaded to a change that is in a
571 pipeline, the existing entry in the pipeline will be removed (with
572 jobs canceled and any dependent changes that can no longer merge as
573 well. To suppress this behavior (and allow jobs to continue
574 running), set this to ``false``. Default: ``true``.
575
James E. Blair17dd6772015-02-09 14:45:18 -0800576**ignore-dependencies**
577 In any kind of pipeline (dependent or independent), Zuul will
578 attempt to enqueue all dependencies ahead of the current change so
579 that they are tested together (independent pipelines report the
580 results of each change regardless of the results of changes ahead).
581 To ignore dependencies completely in an independent pipeline, set
582 this to ``true``. This option is ignored by dependent pipelines.
583 The default is: ``false``.
584
James E. Blaircdd00072012-06-08 19:17:28 -0700585**success**
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000586 Describes where Zuul should report to if all the jobs complete
587 successfully.
James E. Blaircdd00072012-06-08 19:17:28 -0700588 This section is optional; if it is omitted, Zuul will run jobs and
589 do nothing on success; it will not even report a message to Gerrit.
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000590 If the section is present, the listed reporter plugins will be
591 asked to report on the jobs.
592 Each reporter's value dictionary is handled by the reporter. See
593 reporters for more details.
James E. Blaircdd00072012-06-08 19:17:28 -0700594
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400595**failure**
James E. Blaircdd00072012-06-08 19:17:28 -0700596 Uses the same syntax as **success**, but describes what Zuul should
597 do if at least one job fails.
James E. Blairdc253862012-06-13 17:12:42 -0700598
Joshua Heskethb7179772014-01-30 23:30:46 +1100599**merge-failure**
600 Uses the same syntax as **success**, but describes what Zuul should
601 do if it is unable to merge in the patchset. If no merge-failure
602 reporters are listed then the ``failure`` reporters will be used to
603 notify of unsuccessful merges.
604
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400605**start**
James E. Blairdc253862012-06-13 17:12:42 -0700606 Uses the same syntax as **success**, but describes what Zuul should
Clark Boylan00635dc2012-09-19 14:03:08 -0700607 do when a change is added to the pipeline manager. This can be used,
James E. Blairdc253862012-06-13 17:12:42 -0700608 for example, to reset the value of the Verified review category.
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400609
James E. Blair64ed6f22013-07-10 14:07:23 -0700610**precedence**
611 Indicates how the build scheduler should prioritize jobs for
612 different pipelines. Each pipeline may have one precedence, jobs
613 for pipelines with a higher precedence will be run before ones with
614 lower. The value should be one of ``high``, ``normal``, or ``low``.
615 Default: ``normal``.
616
Clark Boylanc2d19e42014-01-23 14:08:58 -0800617**window**
618 DependentPipelineManagers only. Zuul can rate limit
619 DependentPipelineManagers in a manner similar to TCP flow control.
620 Jobs are only started for changes in the queue if they sit in the
621 actionable window for the pipeline. The initial length of this window
622 is configurable with this value. The value given should be a positive
623 integer value. A value of ``0`` disables rate limiting on the
624 DependentPipelineManager.
625 Default: ``20``.
626
627**window-floor**
628 DependentPipelineManagers only. This is the minimum value for the
629 window described above. Should be a positive non zero integer value.
630 Default: ``3``.
631
632**window-increase-type**
633 DependentPipelineManagers only. This value describes how the window
634 should grow when changes are successfully merged by zuul. A value of
635 ``linear`` indicates that ``window-increase-factor`` should be added
636 to the previous window value. A value of ``exponential`` indicates
637 that ``window-increase-factor`` should be multiplied against the
638 previous window value and the result will become the window size.
639 Default: ``linear``.
640
641**window-increase-factor**
Clint Adams041ae512015-06-16 20:02:29 -0400642 DependentPipelineManagers only. The value to be added or multiplied
Clark Boylanc2d19e42014-01-23 14:08:58 -0800643 against the previous window value to determine the new window after
644 successful change merges.
645 Default: ``1``.
646
647**window-decrease-type**
648 DependentPipelineManagers only. This value describes how the window
649 should shrink when changes are not able to be merged by Zuul. A value
650 of ``linear`` indicates that ``window-decrease-factor`` should be
651 subtracted from the previous window value. A value of ``exponential``
652 indicates that ``window-decrease-factor`` should be divided against
653 the previous window value and the result will become the window size.
654 Default: ``exponential``.
655
656**window-decrease-factor**
657 DependentPipelineManagers only. The value to be subtracted or divided
658 against the previous window value to determine the new window after
659 unsuccessful change merges.
660 Default: ``2``.
661
Clark Boylan00635dc2012-09-19 14:03:08 -0700662Some example pipeline configurations are included in the sample layout
663file. The first is called a *check* pipeline::
James E. Blaircdd00072012-06-08 19:17:28 -0700664
665 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700666 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700667 trigger:
668 - event: patchset-created
669 success:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000670 gerrit:
671 verified: 1
James E. Blaircdd00072012-06-08 19:17:28 -0700672 failure:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000673 gerrit:
674 verified: -1
James E. Blaircdd00072012-06-08 19:17:28 -0700675
676This will trigger jobs each time a new patchset (or change) is
677uploaded to Gerrit, and report +/-1 values to Gerrit in the
678``verified`` review category. ::
679
680 - name: gate
Clark Boylan00635dc2012-09-19 14:03:08 -0700681 manager: DependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700682 trigger:
683 - event: comment-added
684 approval:
685 - approved: 1
686 success:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000687 gerrit:
688 verified: 2
689 submit: true
James E. Blaircdd00072012-06-08 19:17:28 -0700690 failure:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000691 gerrit:
692 verified: -2
James E. Blaircdd00072012-06-08 19:17:28 -0700693
694This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the
695``approved`` review category in Gerrit (a non-standard category).
696Changes will be tested in such a way as to guarantee that they will be
697merged exactly as tested, though that will happen in parallel by
698creating a virtual queue of dependent changes and performing
699speculative execution of jobs. ::
700
701 - name: post
Clark Boylan00635dc2012-09-19 14:03:08 -0700702 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700703 trigger:
704 - event: ref-updated
705 ref: ^(?!refs/).*$
706
707This will trigger jobs whenever a change is merged to a named branch
708(e.g., ``master``). No output will be reported to Gerrit. This is
709useful for side effects such as creating per-commit tarballs. ::
710
711 - name: silent
Clark Boylan00635dc2012-09-19 14:03:08 -0700712 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700713 trigger:
714 - event: patchset-created
715
716This also triggers jobs when changes are uploaded to Gerrit, but no
717results are reported to Gerrit. This is useful for jobs that are in
Antoine Mussoce333842012-10-16 14:42:35 +0200718development and not yet ready to be presented to developers. ::
719
720 pipelines:
721 - name: post-merge
722 manager: IndependentPipelineManager
723 trigger:
724 - event: change-merged
725 success:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000726 gerrit:
727 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200728 failure:
Joshua Hesketh1879cf72013-08-19 14:13:15 +1000729 gerrit:
730 force-message: True
Antoine Mussoce333842012-10-16 14:42:35 +0200731
732The ``change-merged`` events happen when a change has been merged in the git
733repository. The change is thus closed and Gerrit will not accept modifications
734to the review scoring such as ``code-review`` or ``verified``. By using the
735``force-message: True`` parameter, Zuul will pass ``--force-message`` to the
736``gerrit review`` command, thus making sure the message is actually
737sent back to Gerrit regardless of approval scores.
738That kind of pipeline is nice to run regression or performance tests.
739
740.. note::
741 The ``change-merged`` event does not include the commit sha1 which can be
742 hazardous, it would let you report back to Gerrit though. If you were to
Michael Prokop526926a2013-10-24 16:16:57 +0200743 build a tarball for a specific commit, you should consider instead using
Łukasz Jernaś048acb42014-03-02 18:49:41 +0100744 the ``ref-updated`` event which does include the commit sha1 (but lacks the
Antoine Mussoce333842012-10-16 14:42:35 +0200745 Gerrit change number).
James E. Blaircdd00072012-06-08 19:17:28 -0700746
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100747
748.. _jobs:
749
James E. Blaircdd00072012-06-08 19:17:28 -0700750Jobs
751""""
752
753The jobs section is optional, and can be used to set attributes of
754jobs that are independent of their association with a project. For
755example, if a job should return a customized message on failure, that
756may be specified here. Otherwise, Zuul does not need to be told about
757each job as it builds a list from the project specification.
758
759**name**
760 The name of the job. This field is treated as a regular expression
761 and will be applied to each job that matches.
762
James E. Blairc8a1e052014-02-25 09:29:26 -0800763**queue-name (optional)**
764 Zuul will automatically combine projects that share a job into
765 shared change queues for dependent pipeline managers. In order to
766 report statistics about these queues, it is convenient for them to
767 have names. Zuul can automatically name change queues, however
768 these can grow quite long and are prone to changing as projects in
769 the queue change. If you assign a queue-name to a job, Zuul will
770 use that as the name for the shared change queue that contains that
771 job instead of the automatically generated one. It is an error for
772 a shared change queue to have more than one job with a queue-name if
773 they are not the same.
774
James E. Blaire5a847f2012-07-10 15:29:14 -0700775**failure-message (optional)**
776 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700777
James E. Blaire5a847f2012-07-10 15:29:14 -0700778**success-message (optional)**
779 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700780
James E. Blair6aea36d2012-12-17 13:03:24 -0800781**failure-pattern (optional)**
782 The URL that should be reported to Gerrit if the job fails.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700783 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800784 zuul.conf. May be supplied as a string pattern with substitutions
785 as described in url_pattern in :ref:`zuulconf`.
786
787**success-pattern (optional)**
788 The URL that should be reported to Gerrit if the job succeeds.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700789 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800790 zuul.conf. May be supplied as a string pattern with substitutions
791 as described in url_pattern in :ref:`zuulconf`.
792
James E. Blair222d4982012-07-16 09:31:19 -0700793**hold-following-changes (optional)**
794 This is a boolean that indicates that changes that follow this
Clark Boylan00635dc2012-09-19 14:03:08 -0700795 change in a dependent change pipeline should wait until this job
James E. Blair222d4982012-07-16 09:31:19 -0700796 succeeds before launching. If this is applied to a very short job
797 that can predict whether longer jobs will fail early, this can be
798 used to reduce the number of jobs that Zuul will launch and
799 ultimately have to cancel. In that case, a small amount of
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400800 parallelization of jobs is traded for more efficient use of testing
James E. Blair222d4982012-07-16 09:31:19 -0700801 resources. On the other hand, to apply this to a long running job
802 would largely defeat the parallelization of dependent change testing
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400803 that is the main feature of Zuul. Default: ``false``.
James E. Blair222d4982012-07-16 09:31:19 -0700804
James E. Blaire5a847f2012-07-10 15:29:14 -0700805**branch (optional)**
James E. Blaircdd00072012-06-08 19:17:28 -0700806 This job should only be run on matching branches. This field is
807 treated as a regular expression and multiple branches may be
808 listed.
809
James E. Blair70c71582013-03-06 08:50:50 -0800810**files (optional)**
811 This job should only be run if at least one of the files involved in
812 the change (added, deleted, or modified) matches at least one of the
813 file patterns listed here. This field is treated as a regular
814 expression and multiple expressions may be listed.
815
Maru Newby3fe5f852015-01-13 04:22:14 +0000816**skip-if (optional)**
817
818 This job should not be run if all the patterns specified by the
819 optional fields listed below match on their targets. When multiple
820 sets of parameters are provided, this job will be skipped if any set
821 matches. For example: ::
822
823 jobs:
824 - name: check-tempest-dsvm-neutron
825 skip-if:
826 - project: ^openstack/neutron$
827 branch: ^stable/juno$
828 all-files-match-any:
829 - ^neutron/tests/.*$
830 - ^tools/.*$
831 - all-files-match-any:
832 - ^doc/.*$
833 - ^.*\.rst$
834
835 With this configuration, the job would be skipped for a neutron
836 patchset for the stable/juno branch provided that every file in the
837 change matched at least one of the specified file regexes. The job
838 will also be skipped for any patchset that modified only the doc
839 tree or rst files.
840
841 *project* (optional)
842 The regular expression to match against the project of the change.
843
844 *branch* (optional)
845 The regular expression to match against the branch or ref of the
846 change.
847
848 *all-files-match-any* (optional)
849 A list of regular expressions intended to match the files involved
850 in the change. This parameter will be considered matching a
851 change only if all files in a change match at least one of these
852 expressions.
853
854 The pattern for '/COMMIT_MSG' is always matched on and does not
855 have to be included.
856
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400857**voting (optional)**
858 Boolean value (``true`` or ``false``) that indicates whatever
859 a job is voting or not. Default: ``true``.
860
James E. Blaire5a847f2012-07-10 15:29:14 -0700861**parameter-function (optional)**
862 Specifies a function that should be applied to the parameters before
863 the job is launched. The function should be defined in a python file
864 included with the :ref:`includes` directive. The function
865 should have the following signature:
866
James E. Blaird0470972013-07-29 10:05:43 -0700867 .. function:: parameters(item, job, parameters)
James E. Blaire5a847f2012-07-10 15:29:14 -0700868
869 Manipulate the parameters passed to a job before a build is
870 launched. The ``parameters`` dictionary will already contain the
871 standard Zuul job parameters, and is expected to be modified
872 in-place.
873
James E. Blaird78576a2013-07-09 10:39:17 -0700874 :param item: the current queue item
875 :type item: zuul.model.QueueItem
James E. Blaird0470972013-07-29 10:05:43 -0700876 :param job: the job about to be run
877 :type job: zuul.model.Job
James E. Blaire5a847f2012-07-10 15:29:14 -0700878 :param parameters: parameters to be passed to the job
879 :type parameters: dict
880
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700881 If the parameter **ZUUL_NODE** is set by this function, then it will
882 be used to specify on what node (or class of node) the job should be
883 run.
884
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100885**swift**
886 If :ref:`swift` is configured then each job can define a destination
887 container for the builder to place logs and/or assets into. Multiple
888 containers can be listed for each job by providing a unique ``name``.
889
890 *name*
891 Set an identifying name for the container. This is used in the
892 parameter key sent to the builder. For example if it ``logs`` then
893 one of the parameters sent will be ``SWIFT_logs_CONTAINER``
894 (case-sensitive).
895
896 Each of the defaults defined in :ref:`swift` can be overwritten as:
897
898 *container* (optional)
899 Container name to place the log into
900 ``For example, logs``
901
902 *expiry* (optional)
903 How long the signed destination should be available for
904
James E. Blaird6500232014-06-23 15:05:48 -0700905 *max-file-size** (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100906 The maximum size of an individual file
907
James E. Blaird6500232014-06-23 15:05:48 -0700908 *max_file_size** (optional, deprecated)
909 A deprecated alternate spelling of *max-file-size*.
910
911 *max-file-count* (optional)
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100912 The maximum number of separate files to allow
913
James E. Blaird6500232014-06-23 15:05:48 -0700914 *max_file_count* (optional, deprecated)
915 A deprecated alternate spelling of *max-file-count*.
916
917 *logserver-prefix*
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100918 Provide a URL to the CDN or logserver app so that a worker knows
919 what URL to return.
920 ``For example: http://logs.example.org/server.app?obj=``
James E. Blaird6500232014-06-23 15:05:48 -0700921 The worker should return the logserver-prefix url and the object
Joshua Hesketh36c3fa52014-01-22 11:40:52 +1100922 path as the URL in the results data packet.
923
James E. Blaird6500232014-06-23 15:05:48 -0700924 *logserver_prefix* (deprecated)
925 A deprecated alternate spelling of *logserver-prefix*.
926
James E. Blaircdd00072012-06-08 19:17:28 -0700927Here is an example of setting the failure message for jobs that check
928whether a change merges cleanly::
929
930 - name: ^.*-merge$
Jeremy Stanley1c2c3c22015-06-15 21:23:19 +0000931 failure-message: This change or one of its cross-repo dependencies
932 was unable to be automatically merged with the current state of
933 its repository. Please rebase the change and upload a new
934 patchset.
James E. Blaircdd00072012-06-08 19:17:28 -0700935
936Projects
937""""""""
938
Clark Boylan00635dc2012-09-19 14:03:08 -0700939The projects section indicates what jobs should be run in each pipeline
James E. Blaircdd00072012-06-08 19:17:28 -0700940for events associated with each project. It contains a list of
941projects. Here is an example::
942
943 - name: example/project
944 check:
945 - project-merge:
946 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700947 - project-pep8
948 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700949 gate:
950 - project-merge:
951 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700952 - project-pep8
953 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700954 post:
955 - project-publish
956
957**name**
958 The name of the project (as known by Gerrit).
959
James E. Blair19deff22013-08-25 13:17:35 -0700960**merge-mode (optional)**
961 An optional value that indicates what strategy should be used to
962 merge changes to this project. Supported values are:
963
964 ** merge-resolve **
965 Equivalent to 'git merge -s resolve'. This corresponds closely to
966 what Gerrit performs (using JGit) for a project if the "Merge if
967 necessary" merge mode is selected and "Automatically resolve
968 conflicts" is checked. This is the default.
969
970 ** merge **
971 Equivalent to 'git merge'.
972
973 ** cherry-pick **
974 Equivalent to 'git cherry-pick'.
975
Clark Boylan00635dc2012-09-19 14:03:08 -0700976This is followed by a section for each of the pipelines defined above.
977Pipelines may be omitted if no jobs should run for this project in a
978given pipeline. Within the pipeline section, the jobs that should be
James E. Blaircdd00072012-06-08 19:17:28 -0700979executed are listed. If a job is entered as a dictionary key, then
980jobs contained within that key are only executed if the key job
981succeeds. In the above example, project-unittest, project-pep8, and
982project-pyflakes are only executed if project-merge succeeds. This
983can help avoid running unnecessary jobs.
984
James E. Blair18c64442014-03-18 10:14:45 -0700985The special job named ``noop`` is internal to Zuul and will always
986return ``SUCCESS`` immediately. This can be useful if you require
987that all changes be processed by a pipeline but a project has no jobs
988that can be run on it.
989
Andreas Jaegerbcfbf932014-09-29 20:21:44 +0200990.. 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 -0700991
Antoine Musso80edd5a2013-02-13 15:37:53 +0100992Project Templates
993"""""""""""""""""
994
Michael Prokop526926a2013-10-24 16:16:57 +0200995Whenever you have lot of similar projects (such as plugins for a project) you
Antoine Musso80edd5a2013-02-13 15:37:53 +0100996will most probably want to use the same pipeline configurations. The
997project templates let you define pipelines and job name templates to trigger.
998One can then just apply the template on its project which make it easier to
Michael Prokop526926a2013-10-24 16:16:57 +0200999update several similar projects. As an example::
Antoine Musso80edd5a2013-02-13 15:37:53 +01001000
1001 project-templates:
1002 # Name of the template
1003 - name: plugin-triggering
1004 # Definition of pipelines just like for a `project`
1005 check:
1006 - '{jobprefix}-merge':
1007 - '{jobprefix}-pep8'
1008 - '{jobprefix}-pyflakes'
1009 gate:
1010 - '{jobprefix}-merge':
1011 - '{jobprefix}-unittest'
1012 - '{jobprefix}-pep8'
1013 - '{jobprefix}-pyflakes'
1014
1015In your projects definition, you will then apply the template using the template
1016key::
1017
1018 projects:
1019 - name: plugin/foobar
1020 template:
1021 - name: plugin-triggering
1022 jobprefix: plugin-foobar
1023
James E. Blairaea6cf62013-12-16 15:38:12 -08001024You can pass several parameters to a template. A ``parameter`` value
1025will be used for expansion of ``{parameter}`` in the template
1026strings. The parameter ``name`` will be automatically provided and
1027will contain the short name of the project, that is the portion of the
1028project name after the last ``/`` character.
James E. Blaircdd00072012-06-08 19:17:28 -07001029
James E. Blair3e98c022013-12-16 15:25:38 -08001030Multiple templates can be combined in a project, and the jobs from all
1031of those templates will be added to the project. Individual jobs may
1032also be added::
1033
1034 projects:
1035 - name: plugin/foobar
1036 template:
1037 - name: plugin-triggering
1038 jobprefix: plugin-foobar
1039 - name: plugin-extras
1040 jobprefix: plugin-foobar
1041 check:
1042 - foobar-extra-special-job
1043
Steven Dake21ef9ad2014-08-25 23:08:14 -07001044Individual jobs may optionally be added to pipelines (e.g. check,
Atsushi SAKAI5d7e93b2015-07-28 22:15:48 +09001045gate, et cetera) for a project, in addition to those provided by
Steven Dake21ef9ad2014-08-25 23:08:14 -07001046templates.
1047
James E. Blair3e98c022013-12-16 15:25:38 -08001048The order of the jobs listed in the project (which only affects the
1049order of jobs listed on the report) will be the jobs from each
1050template in the order listed, followed by any jobs individually listed
1051for the project.
1052
1053Note that if multiple templates are used for a project and one
1054template specifies a job that is also specified in another template,
James E. Blair12a92b12014-03-26 11:54:53 -07001055or specified in the project itself, the configuration defined by
1056either the last template or the project itself will take priority.
James E. Blair3e98c022013-12-16 15:25:38 -08001057
James E. Blaircdd00072012-06-08 19:17:28 -07001058logging.conf
1059~~~~~~~~~~~~
1060This file is optional. If provided, it should be a standard
1061:mod:`logging.config` module configuration file. If not present, Zuul will
1062output all log messages of DEBUG level or higher to the console.
1063
1064Starting Zuul
1065-------------
1066
1067To start Zuul, run **zuul-server**::
1068
Antoine Mussob3aa8282013-04-19 15:16:59 +02001069 usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version]
James E. Blaircdd00072012-06-08 19:17:28 -07001070
1071 Project gating system.
1072
1073 optional arguments:
1074 -h, --help show this help message and exit
1075 -c CONFIG specify the config file
Antoine Mussob3aa8282013-04-19 15:16:59 +02001076 -l LAYOUT specify the layout file
James E. Blaircdd00072012-06-08 19:17:28 -07001077 -d do not run as a daemon
Antoine Mussob3aa8282013-04-19 15:16:59 +02001078 -t validate layout file syntax
1079 --version show zuul version
James E. Blaircdd00072012-06-08 19:17:28 -07001080
1081You may want to use the ``-d`` argument while you are initially setting
1082up Zuul so you can detect any configuration errors quickly. Under
1083normal operation, omit ``-d`` and let Zuul run as a daemon.
1084
1085If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will
1086stop executing new jobs, wait until all executing jobs are finished,
1087reload its configuration, and resume. Any values in any of the
1088configuration files may be changed, except the location of Zuul's PID
1089file (a change to that will be ignored until Zuul is restarted).
Clark Boylanf231fa22013-02-08 12:28:53 -08001090
1091If you send a SIGUSR1 to the zuul-server process, Zuul will stop
1092executing new jobs, wait until all executing jobs are finished,
1093then exit. While waiting to exit Zuul will queue Gerrit events and
1094save these events prior to exiting. When Zuul starts again it will
1095read these saved events and act on them.
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001096
Michael Prokop526926a2013-10-24 16:16:57 +02001097If you need to abort Zuul and intend to manually requeue changes for
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001098jobs which were running in its pipelines, prior to terminating you can
1099use the zuul-changes.py tool script to simplify the process. For
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001100example, this would give you a list of zuul-enqueue commands to requeue
1101changes for the gate and check pipelines respectively::
Jeremy Stanley93e05f42013-03-08 17:29:17 +00001102
Ramy Asselindda8e6a2015-03-31 14:59:39 -07001103 ./tools/zuul-changes.py http://zuul.openstack.org/ gate
1104 ./tools/zuul-changes.py http://zuul.openstack.org/ check
Clark Boylanfba9b242013-08-20 10:11:17 -07001105
Antoine Musso29eab012014-10-28 21:35:22 +01001106If you send a SIGUSR2 to the zuul-server process, or the forked process
1107that runs the Gearman daemon, Zuul will dump a stack trace for each
1108running thread into its debug log. It is written under the log bucket
1109``zuul.stack_dump``. This is useful for tracking down deadlock or
1110otherwise slow threads.
Antoine Mussod0f06262014-06-04 09:54:24 +02001111
1112When `yappi <https://code.google.com/p/yappi/>`_ (Yet Another Python
1113Profiler) is available, additional functions' and threads' stats are
1114emitted as well. The first SIGUSR2 will enable yappi, on the second
1115SIGUSR2 it dumps the information collected, resets all yappi state and
1116stops profiling. This is to minimize the impact of yappi on a running
1117system.