blob: d5dabcd41baa9ec8547584607657e49eeab2eefa [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
13 other config files
James E. Blaircdd00072012-06-08 19:17:28 -070014**layout.yaml**
Clark Boylan00635dc2012-09-19 14:03:08 -070015 Project and pipeline configuration -- what Zuul does
James E. Blaircdd00072012-06-08 19:17:28 -070016**logging.conf**
17 Python logging config
18
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
K Jonathan Harker97e457e2013-02-26 13:29:38 -080039<https://github.com/openstack-infra/zuul/blob/master/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**
49 Port on which the Gearman server is listening
50 ``port=4730``
Clark Boylan9b670902012-09-28 13:47:56 -070051
52gerrit
53""""""
54
55**server**
56 FQDN of Gerrit server.
57 ``server=review.example.com``
58
Antoine Musso27475012012-11-26 09:53:01 +010059**baseurl**
60 Optional: path to Gerrit web interface. Defaults to ``https://<value
61 of server>/``. ``baseurl=https://review.example.com/review_site/``
62
Clark Boylan9b670902012-09-28 13:47:56 -070063**user**
64 User name to use when logging into above server via ssh.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070065 ``user=zuul``
Clark Boylan9b670902012-09-28 13:47:56 -070066
67**sshkey**
68 Path to SSH key to use when logging into above server.
James E. Blair1f4c2bb2013-04-26 08:40:46 -070069 ``sshkey=/home/zuul/.ssh/id_rsa``
Clark Boylan9b670902012-09-28 13:47:56 -070070
71zuul
72""""
73
74**layout_config**
75 Path to layout config file.
76 ``layout_config=/etc/zuul/layout.yaml``
77
78**log_config**
79 Path to log config file.
80 ``log_config=/etc/zuul/logging.yaml``
81
82**pidfile**
83 Path to PID lock file.
84 ``pidfile=/var/run/zuul/zuul.pid``
85
86**state_dir**
87 Path to directory that Zuul should save state to.
88 ``state_dir=/var/lib/zuul``
89
90**git_dir**
91 Directory that Zuul should clone local git repositories to.
92 ``git_dir=/var/lib/zuul/git``
93
Paul Belangerb67aba12013-05-13 19:22:14 -040094**git_user_email**
95 Optional: Value to pass to `git config user.email`.
96 ``git_user_email=zuul@example.com``
97
98**git_user_name**
99 Optional: Value to pass to `git config user.name`.
100 ``git_user_name=zuul``
101
Clark Boylan9b670902012-09-28 13:47:56 -0700102**push_change_refs**
103 Boolean value (``true`` or ``false``) that determines if Zuul should
104 push change refs to the git origin server for the git repositories in
105 git_dir.
106 ``push_change_refs=true``
107
James E. Blair0ac6c012013-04-26 09:04:23 -0700108**report_times**
109 Boolean value (``true`` or ``false``) that determines if Zuul should
110 include elapsed times for each job in the textual report.
111 ``report_times=true``
112
Clark Boylan9b670902012-09-28 13:47:56 -0700113**status_url**
114 URL that will be posted in Zuul comments made to Gerrit changes when
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700115 starting jobs for a change.
116 ``status_url=https://zuul.example.com/status``
Clark Boylan9b670902012-09-28 13:47:56 -0700117
118**url_pattern**
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700119 If you are storing build logs external to the system that originally
120 ran jobs and wish to link to those logs when Zuul makes comments on
121 Gerrit changes for completed jobs this setting configures what the
122 URLs for those links should be.
Clark Boylan9b670902012-09-28 13:47:56 -0700123 ``http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}``
124
James E. Blaircdd00072012-06-08 19:17:28 -0700125layout.yaml
126~~~~~~~~~~~
127
Clark Boylan00635dc2012-09-19 14:03:08 -0700128This is the main configuration file for Zuul, where all of the pipelines
James E. Blaircdd00072012-06-08 19:17:28 -0700129and projects are defined, what tests should be run, and what actions
Clark Boylan00635dc2012-09-19 14:03:08 -0700130Zuul should perform. There are three sections: pipelines, jobs, and
James E. Blaircdd00072012-06-08 19:17:28 -0700131projects.
132
James E. Blaire5a847f2012-07-10 15:29:14 -0700133.. _includes:
134
135Includes
136""""""""
137
138Custom functions to be used in Zuul's configuration may be provided
139using the ``includes`` directive. It accepts a list of files to
140include, and currently supports one type of inclusion, a python file::
141
142 includes:
143 - python-file: local_functions.py
144
145**python-file**
146 The path to a python file. The file will be loaded and objects that
147 it defines will be placed in a special environment which can be
148 referenced in the Zuul configuration. Currently only the
149 parameter-function attribute of a Job uses this feature.
150
Clark Boylan00635dc2012-09-19 14:03:08 -0700151Pipelines
152"""""""""
James E. Blaircdd00072012-06-08 19:17:28 -0700153
Clark Boylan00635dc2012-09-19 14:03:08 -0700154Zuul can have any number of independent pipelines. Whenever a matching
155Gerrit event is found for a pipeline, that event is added to the
156pipeline, and the jobs specified for that pipeline are run. When all
157jobs specified for the pipeline that were triggered by an event are
158completed, Zuul reports back to Gerrit the results.
James E. Blaircdd00072012-06-08 19:17:28 -0700159
Clark Boylan00635dc2012-09-19 14:03:08 -0700160There are no pre-defined pipelines in Zuul, rather you can define
161whatever pipelines you need in the layout file. This is a very flexible
162system that can accommodate many kinds of workflows.
James E. Blaircdd00072012-06-08 19:17:28 -0700163
Clark Boylan00635dc2012-09-19 14:03:08 -0700164Here is a quick example of a pipeline definition followed by an
James E. Blaircdd00072012-06-08 19:17:28 -0700165explanation of each of the parameters::
166
167 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700168 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700169 trigger:
170 - event: patchset-created
171 success:
172 verified: 1
173 failure:
174 verified: -1
175
176**name**
177 This is used later in the project definition to indicate what jobs
Clark Boylan00635dc2012-09-19 14:03:08 -0700178 should be run for events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700179
James E. Blair8dbd56a2012-12-22 10:55:10 -0800180**description**
181 This is an optional field that may be used to provide a textual
182 description of the pipeline.
183
James E. Blair56370192013-01-14 15:47:28 -0800184**success-message**
185 An optional field that supplies the introductory text in message
186 reported back to Gerrit when all the voting builds are successful.
187 Defaults to "Build successful."
188
189**failure-message**
190 An optional field that supplies the introductory text in message
191 reported back to Gerrit when at least one voting build fails.
192 Defaults to "Build failed."
193
James E. Blaircdd00072012-06-08 19:17:28 -0700194**manager**
Clark Boylan00635dc2012-09-19 14:03:08 -0700195 There are currently two schemes for managing pipelines:
James E. Blaircdd00072012-06-08 19:17:28 -0700196
Clark Boylan00635dc2012-09-19 14:03:08 -0700197 *IndependentPipelineManager*
198 Every event in this pipeline should be treated as independent of
199 other events in the pipeline. This is appropriate when the order of
200 events in the pipeline doesn't matter because the results of the
201 actions this pipeline performs can not affect other events in the
202 pipeline. For example, when a change is first uploaded for review,
James E. Blaircdd00072012-06-08 19:17:28 -0700203 you may want to run tests on that change to provide early feedback
204 to reviewers. At the end of the tests, the change is not going to
205 be merged, so it is safe to run these tests in parallel without
Clark Boylan00635dc2012-09-19 14:03:08 -0700206 regard to any other changes in the pipeline. They are independent.
James E. Blaircdd00072012-06-08 19:17:28 -0700207
Clark Boylan00635dc2012-09-19 14:03:08 -0700208 Another type of pipeline that is independent is a post-merge
209 pipeline. In that case, the changes have already merged, so the
210 results can not affect any other events in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700211
Clark Boylan00635dc2012-09-19 14:03:08 -0700212 *DependentPipelineManager*
213 The dependent pipeline manager is designed for gating. It ensures
James E. Blaircdd00072012-06-08 19:17:28 -0700214 that every change is tested exactly as it is going to be merged
215 into the repository. An ideal gating system would test one change
216 at a time, applied to the tip of the repository, and only if that
217 change passed tests would it be merged. Then the next change in
218 line would be tested the same way. In order to achieve parallel
Clark Boylan00635dc2012-09-19 14:03:08 -0700219 testing of changes, the dependent pipeline manager performs
James E. Blaircdd00072012-06-08 19:17:28 -0700220 speculative execution on changes. It orders changes based on
Clark Boylan00635dc2012-09-19 14:03:08 -0700221 their entry into the pipeline. It begins testing all changes in
222 parallel, assuming that each change ahead in the pipeline will pass
James E. Blaircdd00072012-06-08 19:17:28 -0700223 its tests. If they all succeed, all the changes can be tested and
Clark Boylan00635dc2012-09-19 14:03:08 -0700224 merged in parallel. If a change near the front of the pipeline
225 fails its tests, each change behind it ignores whatever tests have
226 been completed and are tested again without the change in front.
227 This way gate tests may run in parallel but still be tested
228 correctly, exactly as they will appear in the repository when
229 merged.
James E. Blaircdd00072012-06-08 19:17:28 -0700230
Clark Boylan00635dc2012-09-19 14:03:08 -0700231 One important characteristic of the DependentPipelineManager is that
James E. Blaircdd00072012-06-08 19:17:28 -0700232 it analyzes the jobs that are triggered by different projects, and
233 if those projects have jobs in common, it treats those projects as
234 related, and they share a single virtual queue of changes. Thus,
235 if there is a job that performs integration testing on two
236 projects, those two projects will automatically share a virtual
237 change queue. If a third project does not invoke that job, it
Clark Boylan00635dc2012-09-19 14:03:08 -0700238 will be part of a separate virtual change queue, and changes to
239 it will not depend on changes to the first two jobs.
James E. Blaircdd00072012-06-08 19:17:28 -0700240
241 For more detail on the theory and operation of Zuul's
Clark Boylan00635dc2012-09-19 14:03:08 -0700242 DependentPipelineManager, see: :doc:`gating`.
James E. Blaircdd00072012-06-08 19:17:28 -0700243
244**trigger**
Clark Boylan00635dc2012-09-19 14:03:08 -0700245 This describes what Gerrit events should be placed in the pipeline.
James E. Blaircdd00072012-06-08 19:17:28 -0700246 Triggers are not exclusive -- matching events may be placed in
Clark Boylan00635dc2012-09-19 14:03:08 -0700247 multiple pipelines, and they will behave independently in each of the
248 pipelines they match. Multiple triggers may be listed. Further
James E. Blaircdd00072012-06-08 19:17:28 -0700249 parameters describe the kind of events that match:
250
251 *event*
252 The event name from gerrit. Examples: ``patchset-created``,
253 ``comment-added``, ``ref-updated``. This field is treated as a
254 regular expression.
255
256 *branch*
257 The branch associated with the event. Example: ``master``. This
258 field is treated as a regular expression, and multiple branches may
259 be listed.
260
261 *ref*
262 On ref-updated events, the branch parameter is not used, instead the
263 ref is provided. Currently Gerrit has the somewhat idiosyncratic
264 behavior of specifying bare refs for branch names (e.g., ``master``),
265 but full ref names for other kinds of refs (e.g., ``refs/tags/foo``).
266 Zuul matches what you put here exactly against what Gerrit
267 provides. This field is treated as a regular expression, and
268 multiple refs may be listed.
269
270 *approval*
271 This is only used for ``comment-added`` events. It only matches if
272 the event has a matching approval associated with it. Example:
273 ``code-review: 2`` matches a ``+2`` vote on the code review category.
274 Multiple approvals may be listed.
275
Antoine Mussob4e809e2012-12-06 16:58:06 +0100276 *email_filter*
277 This is used for any event. It takes a regex applied on the performer
Antoine Musso5f110422012-12-18 23:22:13 +0100278 email, i.e Gerrit account email address. If you want to specify
279 several email filters, you must use a YAML list. Make sure to use non
280 greedy matchers and to escapes dots!
281 Example: ``email_filter: ^.*?@example\.org$``.
Antoine Mussob4e809e2012-12-06 16:58:06 +0100282
Clark Boylanb9bcb402012-06-29 17:44:05 -0700283 *comment_filter*
284 This is only used for ``comment-added`` events. It accepts a list of
285 regexes that are searched for in the comment string. If any of these
286 regexes matches a portion of the comment string the trigger is
287 matched. ``comment_filter: retrigger`` will match when comments
288 containing 'retrigger' somewhere in the comment text are added to a
289 change.
290
James E. Blair2fa50962013-01-30 21:50:41 -0800291**dequeue-on-new-patchset**
292 Normally, if a new patchset is uploaded to a change that is in a
293 pipeline, the existing entry in the pipeline will be removed (with
294 jobs canceled and any dependent changes that can no longer merge as
295 well. To suppress this behavior (and allow jobs to continue
296 running), set this to ``false``. Default: ``true``.
297
James E. Blaircdd00072012-06-08 19:17:28 -0700298**success**
299 Describes what Zuul should do if all the jobs complete successfully.
300 This section is optional; if it is omitted, Zuul will run jobs and
301 do nothing on success; it will not even report a message to Gerrit.
302 If the section is present, it will leave a message on the Gerrit
303 review. Each additional argument is assumed to be an argument to
304 ``gerrit review``, with the boolean value of ``true`` simply
305 indicating that the argument should be present without following it
306 with a value. For example, ``verified: 1`` becomes ``gerrit
307 review --verified 1`` and ``submit: true`` becomes ``gerrit review
308 --submit``.
309
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400310**failure**
James E. Blaircdd00072012-06-08 19:17:28 -0700311 Uses the same syntax as **success**, but describes what Zuul should
312 do if at least one job fails.
James E. Blairdc253862012-06-13 17:12:42 -0700313
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400314**start**
James E. Blairdc253862012-06-13 17:12:42 -0700315 Uses the same syntax as **success**, but describes what Zuul should
Clark Boylan00635dc2012-09-19 14:03:08 -0700316 do when a change is added to the pipeline manager. This can be used,
James E. Blairdc253862012-06-13 17:12:42 -0700317 for example, to reset the value of the Verified review category.
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400318
Clark Boylan00635dc2012-09-19 14:03:08 -0700319Some example pipeline configurations are included in the sample layout
320file. The first is called a *check* pipeline::
James E. Blaircdd00072012-06-08 19:17:28 -0700321
322 - name: check
Clark Boylan00635dc2012-09-19 14:03:08 -0700323 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700324 trigger:
325 - event: patchset-created
326 success:
327 verified: 1
328 failure:
329 verified: -1
330
331This will trigger jobs each time a new patchset (or change) is
332uploaded to Gerrit, and report +/-1 values to Gerrit in the
333``verified`` review category. ::
334
335 - name: gate
Clark Boylan00635dc2012-09-19 14:03:08 -0700336 manager: DependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700337 trigger:
338 - event: comment-added
339 approval:
340 - approved: 1
341 success:
342 verified: 2
343 submit: true
344 failure:
345 verified: -2
346
347This will trigger jobs whenever a reviewer leaves a vote of ``1`` in the
348``approved`` review category in Gerrit (a non-standard category).
349Changes will be tested in such a way as to guarantee that they will be
350merged exactly as tested, though that will happen in parallel by
351creating a virtual queue of dependent changes and performing
352speculative execution of jobs. ::
353
354 - name: post
Clark Boylan00635dc2012-09-19 14:03:08 -0700355 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700356 trigger:
357 - event: ref-updated
358 ref: ^(?!refs/).*$
359
360This will trigger jobs whenever a change is merged to a named branch
361(e.g., ``master``). No output will be reported to Gerrit. This is
362useful for side effects such as creating per-commit tarballs. ::
363
364 - name: silent
Clark Boylan00635dc2012-09-19 14:03:08 -0700365 manager: IndependentPipelineManager
James E. Blaircdd00072012-06-08 19:17:28 -0700366 trigger:
367 - event: patchset-created
368
369This also triggers jobs when changes are uploaded to Gerrit, but no
370results are reported to Gerrit. This is useful for jobs that are in
Antoine Mussoce333842012-10-16 14:42:35 +0200371development and not yet ready to be presented to developers. ::
372
373 pipelines:
374 - name: post-merge
375 manager: IndependentPipelineManager
376 trigger:
377 - event: change-merged
378 success:
379 force-message: True
380 failure:
381 force-message: True
382
383The ``change-merged`` events happen when a change has been merged in the git
384repository. The change is thus closed and Gerrit will not accept modifications
385to the review scoring such as ``code-review`` or ``verified``. By using the
386``force-message: True`` parameter, Zuul will pass ``--force-message`` to the
387``gerrit review`` command, thus making sure the message is actually
388sent back to Gerrit regardless of approval scores.
389That kind of pipeline is nice to run regression or performance tests.
390
391.. note::
392 The ``change-merged`` event does not include the commit sha1 which can be
393 hazardous, it would let you report back to Gerrit though. If you were to
394 build a tarball for a specific commit, you should consider insteading using
395 the ``ref-updated`` event which does include the commit sha1 (but lack the
396 Gerrit change number).
James E. Blaircdd00072012-06-08 19:17:28 -0700397
398Jobs
399""""
400
401The jobs section is optional, and can be used to set attributes of
402jobs that are independent of their association with a project. For
403example, if a job should return a customized message on failure, that
404may be specified here. Otherwise, Zuul does not need to be told about
405each job as it builds a list from the project specification.
406
407**name**
408 The name of the job. This field is treated as a regular expression
409 and will be applied to each job that matches.
410
James E. Blaire5a847f2012-07-10 15:29:14 -0700411**failure-message (optional)**
412 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700413
James E. Blaire5a847f2012-07-10 15:29:14 -0700414**success-message (optional)**
415 The message that should be reported to Gerrit if the job fails.
James E. Blaircdd00072012-06-08 19:17:28 -0700416
James E. Blair6aea36d2012-12-17 13:03:24 -0800417**failure-pattern (optional)**
418 The URL that should be reported to Gerrit if the job fails.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700419 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800420 zuul.conf. May be supplied as a string pattern with substitutions
421 as described in url_pattern in :ref:`zuulconf`.
422
423**success-pattern (optional)**
424 The URL that should be reported to Gerrit if the job succeeds.
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700425 Defaults to the build URL or the url_pattern configured in
James E. Blair6aea36d2012-12-17 13:03:24 -0800426 zuul.conf. May be supplied as a string pattern with substitutions
427 as described in url_pattern in :ref:`zuulconf`.
428
James E. Blair222d4982012-07-16 09:31:19 -0700429**hold-following-changes (optional)**
430 This is a boolean that indicates that changes that follow this
Clark Boylan00635dc2012-09-19 14:03:08 -0700431 change in a dependent change pipeline should wait until this job
James E. Blair222d4982012-07-16 09:31:19 -0700432 succeeds before launching. If this is applied to a very short job
433 that can predict whether longer jobs will fail early, this can be
434 used to reduce the number of jobs that Zuul will launch and
435 ultimately have to cancel. In that case, a small amount of
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400436 parallelization of jobs is traded for more efficient use of testing
James E. Blair222d4982012-07-16 09:31:19 -0700437 resources. On the other hand, to apply this to a long running job
438 would largely defeat the parallelization of dependent change testing
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400439 that is the main feature of Zuul. Default: ``false``.
James E. Blair222d4982012-07-16 09:31:19 -0700440
James E. Blaire5a847f2012-07-10 15:29:14 -0700441**branch (optional)**
James E. Blaircdd00072012-06-08 19:17:28 -0700442 This job should only be run on matching branches. This field is
443 treated as a regular expression and multiple branches may be
444 listed.
445
James E. Blair70c71582013-03-06 08:50:50 -0800446**files (optional)**
447 This job should only be run if at least one of the files involved in
448 the change (added, deleted, or modified) matches at least one of the
449 file patterns listed here. This field is treated as a regular
450 expression and multiple expressions may be listed.
451
Mathieu Gagnéd6d2a642013-06-11 20:59:58 -0400452**voting (optional)**
453 Boolean value (``true`` or ``false``) that indicates whatever
454 a job is voting or not. Default: ``true``.
455
James E. Blaire5a847f2012-07-10 15:29:14 -0700456**parameter-function (optional)**
457 Specifies a function that should be applied to the parameters before
458 the job is launched. The function should be defined in a python file
459 included with the :ref:`includes` directive. The function
460 should have the following signature:
461
462 .. function:: parameters(change, parameters)
463
464 Manipulate the parameters passed to a job before a build is
465 launched. The ``parameters`` dictionary will already contain the
466 standard Zuul job parameters, and is expected to be modified
467 in-place.
468
469 :param change: the current change
470 :type change: zuul.model.Change
471 :param parameters: parameters to be passed to the job
472 :type parameters: dict
473
James E. Blair1f4c2bb2013-04-26 08:40:46 -0700474 If the parameter **ZUUL_NODE** is set by this function, then it will
475 be used to specify on what node (or class of node) the job should be
476 run.
477
James E. Blaircdd00072012-06-08 19:17:28 -0700478Here is an example of setting the failure message for jobs that check
479whether a change merges cleanly::
480
481 - name: ^.*-merge$
482 failure-message: This change was unable to be automatically merged
483 with the current state of the repository. Please rebase your
484 change and upload a new patchset.
485
486Projects
487""""""""
488
Clark Boylan00635dc2012-09-19 14:03:08 -0700489The projects section indicates what jobs should be run in each pipeline
James E. Blaircdd00072012-06-08 19:17:28 -0700490for events associated with each project. It contains a list of
491projects. Here is an example::
492
493 - name: example/project
494 check:
495 - project-merge:
496 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700497 - project-pep8
498 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700499 gate:
500 - project-merge:
501 - project-unittest
Clark Boylan00635dc2012-09-19 14:03:08 -0700502 - project-pep8
503 - project-pyflakes
James E. Blaircdd00072012-06-08 19:17:28 -0700504 post:
505 - project-publish
506
507**name**
508 The name of the project (as known by Gerrit).
509
Clark Boylan00635dc2012-09-19 14:03:08 -0700510This is followed by a section for each of the pipelines defined above.
511Pipelines may be omitted if no jobs should run for this project in a
512given pipeline. Within the pipeline section, the jobs that should be
James E. Blaircdd00072012-06-08 19:17:28 -0700513executed are listed. If a job is entered as a dictionary key, then
514jobs contained within that key are only executed if the key job
515succeeds. In the above example, project-unittest, project-pep8, and
516project-pyflakes are only executed if project-merge succeeds. This
517can help avoid running unnecessary jobs.
518
Paul Belangerffef9e42013-02-11 22:15:18 -0500519.. seealso:: The OpenStack Zuul configuration for a comprehensive example: https://github.com/openstack-infra/config/blob/master/modules/openstack_project/files/zuul/layout.yaml
James E. Blaircdd00072012-06-08 19:17:28 -0700520
Antoine Musso80edd5a2013-02-13 15:37:53 +0100521Project Templates
522"""""""""""""""""
523
524Whenever you have lot of similiar projects (such as plugins for a project) you
525will most probably want to use the same pipeline configurations. The
526project templates let you define pipelines and job name templates to trigger.
527One can then just apply the template on its project which make it easier to
528update several similiar projects. As an example::
529
530 project-templates:
531 # Name of the template
532 - name: plugin-triggering
533 # Definition of pipelines just like for a `project`
534 check:
535 - '{jobprefix}-merge':
536 - '{jobprefix}-pep8'
537 - '{jobprefix}-pyflakes'
538 gate:
539 - '{jobprefix}-merge':
540 - '{jobprefix}-unittest'
541 - '{jobprefix}-pep8'
542 - '{jobprefix}-pyflakes'
543
544In your projects definition, you will then apply the template using the template
545key::
546
547 projects:
548 - name: plugin/foobar
549 template:
550 - name: plugin-triggering
551 jobprefix: plugin-foobar
552
553You can pass several parameters to a template. A ``parameter`` value will be
554used for expansion of ``{parameter}`` in the template strings.
James E. Blaircdd00072012-06-08 19:17:28 -0700555
556logging.conf
557~~~~~~~~~~~~
558This file is optional. If provided, it should be a standard
559:mod:`logging.config` module configuration file. If not present, Zuul will
560output all log messages of DEBUG level or higher to the console.
561
562Starting Zuul
563-------------
564
565To start Zuul, run **zuul-server**::
566
Antoine Mussob3aa8282013-04-19 15:16:59 +0200567 usage: zuul-server [-h] [-c CONFIG] [-l LAYOUT] [-d] [-t] [--version]
James E. Blaircdd00072012-06-08 19:17:28 -0700568
569 Project gating system.
570
571 optional arguments:
572 -h, --help show this help message and exit
573 -c CONFIG specify the config file
Antoine Mussob3aa8282013-04-19 15:16:59 +0200574 -l LAYOUT specify the layout file
James E. Blaircdd00072012-06-08 19:17:28 -0700575 -d do not run as a daemon
Antoine Mussob3aa8282013-04-19 15:16:59 +0200576 -t validate layout file syntax
577 --version show zuul version
James E. Blaircdd00072012-06-08 19:17:28 -0700578
579You may want to use the ``-d`` argument while you are initially setting
580up Zuul so you can detect any configuration errors quickly. Under
581normal operation, omit ``-d`` and let Zuul run as a daemon.
582
583If you send signal 1 (SIGHUP) to the zuul-server process, Zuul will
584stop executing new jobs, wait until all executing jobs are finished,
585reload its configuration, and resume. Any values in any of the
586configuration files may be changed, except the location of Zuul's PID
587file (a change to that will be ignored until Zuul is restarted).
Clark Boylanf231fa22013-02-08 12:28:53 -0800588
589If you send a SIGUSR1 to the zuul-server process, Zuul will stop
590executing new jobs, wait until all executing jobs are finished,
591then exit. While waiting to exit Zuul will queue Gerrit events and
592save these events prior to exiting. When Zuul starts again it will
593read these saved events and act on them.
Jeremy Stanley93e05f42013-03-08 17:29:17 +0000594
595If you need to abort zuul and intend to manually requeue changes for
596jobs which were running in its pipelines, prior to terminating you can
597use the zuul-changes.py tool script to simplify the process. For
598example, this would give you a list of Gerrit commands to reverify or
599recheck changes for the gate and check pipelines respectively::
600
601 ./tools/zuul-changes.py --review-host=review.openstack.org \
602 http://zuul.openstack.org/ gate 'reverify no bug'
603 ./tools/zuul-changes.py --review-host=review.openstack.org \
604 http://zuul.openstack.org/ check 'recheck no bug'