From a3ba8e309a649ec6c9b2bb5788e5cf73ba69ef73 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 13 May 2020 11:31:01 -0700 Subject: [PATCH] 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 --- playbooks/run-test-command/run.yaml | 2 +- zuul.d/general-jobs.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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"