Add zuul_work_dir to run-test-command
This will make it possible to set up project-specific jobs which always
run in the context of the project to which they belong even when
triggered by a change in another job (think of the "czechlight-clearfog"
image building being triggered from a change in netconf-cli).
Backport: https://review.opendev.org/727855
Change-Id: I2f6f4dd817d1fc271b816a04812ed975cf9f4ff3
diff --git a/roles/run-test-command/tasks/main.yaml b/roles/run-test-command/tasks/main.yaml
index c195cca..6681ea7 100644
--- a/roles/run-test-command/tasks/main.yaml
+++ b/roles/run-test-command/tasks/main.yaml
@@ -1,6 +1,6 @@
- name: Run test_command
command: '{{ test_command }}'
args:
- chdir: '{{ zuul.project.src_dir }}'
+ chdir: '{{ zuul_work_dir | default(zuul.project.src_dir) }}'
environment:
JOB_PERFORM_EXTRA_WORK: '{{ perform_extra_work | ternary("1", "0") }}'