Merge "Move chart-testing to a role and disable version check"

This commit is contained in:
Zuul 2020-01-09 22:31:14 +00:00 committed by Gerrit Code Review
commit 96300f3543
5 changed files with 28 additions and 8 deletions

View File

@ -3,3 +3,4 @@ Helm Roles
.. zuul:autorole:: ensure-helm
.. zuul:autorole:: ensure-chart-testing
.. zuul:autorole:: chart-testing

View File

@ -1,10 +1,4 @@
---
- hosts: all
tasks:
- name: Run linters
# NOTE(mnaser): We use --validate-maintainers=false because chart-testing
# relies on the existance of a remote URL which is /dev/null
# in Zuul and fails.
command: ct lint --validate-maintainers=false
args:
chdir: "{{ zuul.project.src_dir }}"
roles:
- chart-testing

View File

@ -0,0 +1,19 @@
Run chart-testing (for helm charts)
**Role Variables**
.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}
The location of the main working directory of the job.
.. zuul:rolevar:: chart_testing_options
:default: --validate-maintainers=false --check-version-increment=false
Arguments passed to chart testing.
The defaults are suitable for a Zuul environment because
`validate-maintainers` requires a valid git remote (which is not
present in Zuul) and `check-version-increment` requires each commit
to have a new version; Zuul users are expected to set the version
when tagging/publishing a release.

View File

@ -0,0 +1,2 @@
zuul_work_dir: "{{ zuul.project.src_dir }}"
chart_testing_options: --validate-maintainers=false --check-version-increment=false

View File

@ -0,0 +1,4 @@
- name: Run chart-testing
command: "ct lint {{ chart_testing_options }}"
args:
chdir: "{{ zuul_work_dir }}"