diff --git a/playbooks/run-test-command/run.yaml b/playbooks/run-test-command/run.yaml index fb6963169..ceb02475f 100644 --- a/playbooks/run-test-command/run.yaml +++ b/playbooks/run-test-command/run.yaml @@ -14,5 +14,5 @@ - name: Run test_command command: '{{ item }}' args: - chdir: '{{ zuul.project.src_dir }}' + chdir: '{{ zuul_work_dir | default(zuul.project.src_dir) }}' with_items: '{{ test_commands }}' diff --git a/zuul.d/general-jobs.yaml b/zuul.d/general-jobs.yaml index 46e60b0ef..1e3c69d07 100644 --- a/zuul.d/general-jobs.yaml +++ b/zuul.d/general-jobs.yaml @@ -36,6 +36,11 @@ To use this, set the ``test_command`` variable to a single command or a list of commands. For complex list of commands, it is recommended to use a single command that runs a proper script. + + .. zuul:jobvar:: zuul_work_dir + :default: {{ zuul.project.src_dir }} + + Path to operate in. run: playbooks/run-test-command/run.yaml vars: test_command: "exit 1"