Merge "Parameterize the test-setup role"

This commit is contained in:
Zuul 2018-03-08 19:08:24 +00:00 committed by Gerrit Code Review
commit d28c326b36
3 changed files with 18 additions and 1 deletions

View File

@ -8,3 +8,15 @@ be run.
This allows projects to specify test-setup steps (such as creating or
initializing a database) in a form that can be easily run by both an
automated testing system and developers.
**Role Variables**
.. zuul:rolevar:: test_setup_environment
Environment variables to pass in to the test-setup script.
.. zuul:rolevar:: test_setup_args
String of optional command line options passed to
the test-setup script.

View File

@ -1,2 +1,6 @@
---
test_setup_args: ""
test_setup_environment: {}
zuul_work_dir: "src/{{ zuul.project.canonical_name }}"

View File

@ -4,7 +4,8 @@
register: p
- name: Run tools/test-setup.sh
command: tools/test-setup.sh
command: tools/test-setup.sh {{ test_setup_args }}
environment: "{{ test_setup_environment }}"
args:
chdir: "{{ zuul_work_dir }}"
when: