commit | 5f22116b628657c4c91334d50a7e098a545d69f4 | [log] [tgz] |
---|---|---|
author | Tristan Cacqueray <tdecacqu@redhat.com> | Tue Feb 09 23:30:22 2021 +0000 |
committer | Tristan Cacqueray <tdecacqu@redhat.com> | Tue Apr 06 19:50:19 2021 +0000 |
tree | 36d5d4672da7b0d78bf8f854c3b5efa52b39c8b1 | |
parent | ea969883f87799220da4b5d859f8d24b3cb31a7b [diff] |
Improve YAML list indentation Change-Id: Ib5674966e8af8f4d9349be48f9ab82c4a1578fe9
This project provides a declarative configuration to manage your zuul configuration needs.
At a high level, the scope of Bootstrap Your Zuul is to convert a list of connections and tenant settings into:
The project includes Dhall functions and a tool to create the configurations.
Using the command line:
# ./examples/demo.yaml name: local connections: gerrit: ["local"]
$ bootstrap-your-zuul ./examples/demo.yaml * /etc/zuul/main.yaml - tenant: name: local * config/zuul.d/pipelines.yaml - pipeline: name: check failure: sqlreporter: [] manager: independent success: local: Verified: 1 sqlreporter: [] - pipeline: name: gate failure: sqlreporter: [] manager: dependent precedence: high success: local: Verified: 2 submit: true sqlreporter: [] * config/zuul.d/jobs.yaml - job: name: base parent: null description: The base job. pre-run: post-run: extra-vars: zuul_use_fetch_output: true - playbooks/base/post.yaml - playbooks/base/pre.yaml roles: - zuul: opendev.org/zuul/zuul-jobs * playbooks/base/pre.yaml - hosts: localhost tasks: - import_role: name: emit-job-header - import_role: name: log-inventory - hosts: all tasks: - include_role: name: validate-host * playbooks/base/post.yaml - hosts: all tasks: - include_role: name: fetch-output
Or using the dhall function directly:
-- ./examples/demo.dhall let BootstrapYourZuul = ../package.dhall in BootstrapYourZuul.Config::{ , name = "local" , sql = Some "sqlreporter" , connections = [ BootstrapYourZuul.Connection.gerrit "local" ] }
# dhall-to-yaml <<< '(./package.dhall).render ./examples/demo.dhall' jobs: - job: description: The base job. extra-vars: zuul_use_fetch_output: true name: base parent: null post-run: - playbooks/base/post.yaml pre-run: - playbooks/base/pre.yaml roles: - zuul: opendev.org/zuul/zuul-jobs pipelines: - pipeline: failure: local: Verified: -1 sqlreporter: [] manager: independent name: check require: local: current-patchset: true open: true start: local: Verified: 0 success: local: Verified: 1 sqlreporter: [] trigger: local: - event: - patchset-created - event: - change-restored - comment: - "(?i)^(Patch Set [0-9]+:)?( [\\w\\\\+-]*)*(\\n\\n)?\\s*recheck" event: - comment-added - pipeline: failure: local: Verified: -2 sqlreporter: [] manager: dependent name: gate post-review: true precedence: high require: local: approval: Workflow: 1 current-patchset: true open: true start: local: Verified: 0 success: local: Verified: 2 submit: true sqlreporter: [] supercedes: check trigger: local: - approval: Workflow: 1 event: - comment-added - comment: - "(?i)^(Patch Set [0-9]+:)?( [\\w\\\\+-]*)*(\\n\\n)?\\s*reverify" event: - comment-added - pipeline: description: This pipeline runs jobs that operate after each change is merged. failure: sqlreporter: [] manager: supercedent name: post post-review: true precedence: high success: sqlreporter: [] trigger: local: - event: - ref-updated ref: - "^refs/heads/.*$" - pipeline: description: | This pipeline runs jobs that operate after each change is merged in order to promote artifacts generated in the gate pipeline. failure: local: {} sqlreporter: [] manager: supercedent name: promote post-review: true precedence: high success: local: {} sqlreporter: [] trigger: local: - event: - change-merged playbook_post: - hosts: all tasks: - include_role: name: fetch-output playbook_pre: - hosts: localhost tasks: - import_role: name: emit-job-header - import_role: name: log-inventory - hosts: all tasks: - include_role: name: validate-host tenant: - tenant: name: local
Some pipeline are custom, for example to create a periodic trigger:
# dhall-to-yaml <<< 'let BYZ = ./package.dhall in [{pipeline = BYZ.Pipeline.periodic BYZ.Pipeline.Frequency.daily BYZ.Zuul.Pipeline.Reporter.Smtp.default}]' - pipeline: description: Jobs in this queue are triggered daily failure: smtp: {} manager: independent name: periodic-daily post-review: true precedence: low trigger: timer: - time: "0 0 * * * *"
Build the server:
cabal build
cabal run