zuul-jobs/playbooks/run-test-command/run.yaml
James E. Blair a3ba8e309a Add zuul_work_dir to run-test-command
To make it so that a repo can host a simple command which is an
integration test of multiple projects, add the semi-standard
zuul_work_dir variable to the job.

Change-Id: I265469ac9c12c3a38a11b243f3ff747d27141f21
2020-05-13 11:31:01 -07:00

19 lines
496 B
YAML

- hosts: all
tasks:
- name: Convert test_command to list
set_fact:
test_commands: ['{{ test_command }}']
when: test_command | type_debug != 'list'
- name: Use test_command list
set_fact:
test_commands: '{{ test_command }}'
when: test_command | type_debug == 'list'
- name: Run test_command
command: '{{ item }}'
args:
chdir: '{{ zuul_work_dir | default(zuul.project.src_dir) }}'
with_items: '{{ test_commands }}'