From 60ece316073880be6ea72bb1e6f49cc4086218b3 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Thu, 25 Jul 2019 12:08:15 +0200 Subject: [PATCH] Add reference pipelines file for Gerrit driver As it has been done for the Pagure driver, include a reference pipelines section in the Gerrit driver documentation. It helps the reader to better understand the big picture of the Gerrit's pipelines configuration but also provide an almost ready to use pipelines definition file. Change-Id: I5234476f7393ba938e8365b8c908a2ff6f9e8c76 --- doc/source/admin/drivers/gerrit.rst | 8 ++ .../zuul.d/gerrit-reference-pipelines.yaml | 132 ++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 doc/source/admin/examples/zuul-config/zuul.d/gerrit-reference-pipelines.yaml diff --git a/doc/source/admin/drivers/gerrit.rst b/doc/source/admin/drivers/gerrit.rst index 5433df3c23..bfac88a549 100644 --- a/doc/source/admin/drivers/gerrit.rst +++ b/doc/source/admin/drivers/gerrit.rst @@ -333,3 +333,11 @@ order to be enqueued into the pipeline. my-gerrit: approval: - Code-Review: [-1, -2] + +Reference pipelines configuration +--------------------------------- + +Here is an example of standard pipelines you may want to define: + +.. literalinclude:: ../examples/zuul-config/zuul.d/gerrit-reference-pipelines.yaml + :language: yaml diff --git a/doc/source/admin/examples/zuul-config/zuul.d/gerrit-reference-pipelines.yaml b/doc/source/admin/examples/zuul-config/zuul.d/gerrit-reference-pipelines.yaml new file mode 100644 index 0000000000..a20647a03b --- /dev/null +++ b/doc/source/admin/examples/zuul-config/zuul.d/gerrit-reference-pipelines.yaml @@ -0,0 +1,132 @@ +- pipeline: + name: check + description: | + Newly uploaded patchsets enter this pipeline to receive an + initial +/-1 Verified vote. + manager: independent + precedence: low + require: + gerrit: + open: True + current-patchset: True + trigger: + gerrit: + - event: patchset-created + - event: change-restored + - event: comment-added + comment: (?i)^(Patch Set [0-9]+:)?( [\w\\+-]*)*(\n\n)?\s*recheck + success: + gerrit: + # Note that gerrit keywords are case-sensitive. + Verified: 1 + sqlreporter: + failure: + gerrit: + Verified: -1 + sqlreporter: + +- pipeline: + name: gate + description: | + Changes that have been approved by core reviewers are enqueued + in order in this pipeline, and if they pass tests, will be + merged. For documentation on how gating with Zuul works, please see + https://zuul-ci.org/docs/zuul/user/gating.html + manager: dependent + precedence: normal + supercedes: check + post-review: True + require: + gerrit: + open: True + current-patchset: True + approval: + - Workflow: 1 + trigger: + gerrit: + - event: comment-added + approval: + - Workflow: 1 + start: + gerrit: + Verified: 0 + success: + gerrit: + Verified: 2 + submit: true + sqlreporter: + failure: + gerrit: + Verified: -2 + sqlreporter: + window-floor: 20 + window-increase-factor: 2 + +- pipeline: + name: post + description: | + This pipeline runs jobs that operate after each change is + merged. Queue items are identified by the abbreviated hash (git + log --format=%h) of the merge commit. + manager: supercedent + precedence: high + post-review: True + trigger: + gerrit: + - event: ref-updated + ref: ^refs/heads/.*$ + success: + sqlreporter: + failure: + sqlreporter: + +- pipeline: + name: promote + description: | + This pipeline runs jobs that operate after each change is merged + in order to promote artifacts generated in the gate + pipeline. + manager: supercedent + precedence: high + post-review: True + trigger: + gerrit: + - event: change-merged + success: + gerrit: {} + sqlreporter: + failure: + gerrit: {} + sqlreporter: + +- pipeline: + name: release + description: | + When a commit is tagged as a release, this pipeline runs jobs + that publish archives and documentation. + manager: independent + precedence: high + post-review: True + trigger: + gerrit: + - event: ref-updated + ref: ^refs/tags/[0-9]+(\.[0-9]+)*$ + success: + sqlreporter: + failure: + sqlreporter: + +- pipeline: + name: tag + post-review: true + description: This pipeline runs jobs in response to any tag event. + manager: independent + precedence: high + trigger: + gerrit: + - event: ref-updated + ref: ^refs/tags/.*$ + success: + sqlreporter: + failure: + sqlreporter: