Create zuul_workspace_root job variable
This will be a top-level variable used to define the workspace root
for our zuul user.
Change-Id: I4ecd6ead4975691798404f8d9510ed47e20e0c0c
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
diff --git a/playbooks/roles/extra-test-setup/tasks/main.yaml b/playbooks/roles/extra-test-setup/tasks/main.yaml
index 08e46f3..da4259e 100644
--- a/playbooks/roles/extra-test-setup/tasks/main.yaml
+++ b/playbooks/roles/extra-test-setup/tasks/main.yaml
@@ -1,13 +1,13 @@
---
-- name: Check if tools/test-setup.sh exists.
+- name: Check if projects tools/test-setup.sh exists.
stat:
- path: "/home/zuul/workspace/src/{{ zuul.project }}/tools/test-setup.sh"
+ path: "{{ zuul_workspace_root }}/src/{{ zuul.project }}/tools/test-setup.sh"
register: p
- name: Run tools/test-setup.sh.
shell: tools/test-setup.sh
args:
- chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
+ chdir: "{{ zuul_workspace_root }}/src/{{ zuul.project }}"
when:
- p.stat.exists
- p.stat.executable
diff --git a/playbooks/roles/prepare-workspace/defaults/main.yaml b/playbooks/roles/prepare-workspace/defaults/main.yaml
deleted file mode 100644
index 9127ad8..0000000
--- a/playbooks/roles/prepare-workspace/defaults/main.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-# tasks/main.yaml
-prepare_workspace_root: /home/zuul/workspace
diff --git a/playbooks/roles/prepare-workspace/tasks/main.yaml b/playbooks/roles/prepare-workspace/tasks/main.yaml
index d8a5316..c5952c7 100644
--- a/playbooks/roles/prepare-workspace/tasks/main.yaml
+++ b/playbooks/roles/prepare-workspace/tasks/main.yaml
@@ -10,12 +10,12 @@
- name: Create workspace directory.
file:
- path: "{{ prepare_workspace_root }}"
+ path: "{{ zuul_workspace_root }}"
owner: zuul
group: zuul
state: directory
- name: Synchronize src repos to workspace directory.
synchronize:
- dest: "{{ prepare_workspace_root }}"
+ dest: "{{ zuul_workspace_root }}"
src: "{{ zuul.executor.src_root }}"
diff --git a/playbooks/roles/run-bindep/tasks/main.yaml b/playbooks/roles/run-bindep/tasks/main.yaml
index 7717c86..5a9d33e 100644
--- a/playbooks/roles/run-bindep/tasks/main.yaml
+++ b/playbooks/roles/run-bindep/tasks/main.yaml
@@ -2,4 +2,4 @@
- name: Run install-distro-packages.sh
shell: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
args:
- chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
+ chdir: "{{ zuul_workspace_root }}/src/{{ zuul.project }}"
diff --git a/playbooks/roles/run-cover/tasks/main.yaml b/playbooks/roles/run-cover/tasks/main.yaml
index 5fce7f1..caed13c 100644
--- a/playbooks/roles/run-cover/tasks/main.yaml
+++ b/playbooks/roles/run-cover/tasks/main.yaml
@@ -1,4 +1,4 @@
- name: Execute run-cover.sh.
shell: "/usr/local/jenkins/slave_scripts/run-cover.sh {{ run_cover_envlist }}"
args:
- chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
+ chdir: "{{ zuul_workspace_root }}/src/{{ zuul.project }}"
diff --git a/playbooks/roles/run-docs/tasks/main.yaml b/playbooks/roles/run-docs/tasks/main.yaml
index 3266f2b..2250593 100644
--- a/playbooks/roles/run-docs/tasks/main.yaml
+++ b/playbooks/roles/run-docs/tasks/main.yaml
@@ -1,4 +1,4 @@
- name: Execute run-docs.sh.
shell: "/usr/local/jenkins/slave_scripts/run-docs.sh {{ run_docs_envlist }}"
args:
- chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
+ chdir: "{{ zuul_workspace_root }}/src/{{ zuul.project }}"
diff --git a/playbooks/roles/run-tox/tasks/main.yaml b/playbooks/roles/run-tox/tasks/main.yaml
index 1053690..29a4cc4 100644
--- a/playbooks/roles/run-tox/tasks/main.yaml
+++ b/playbooks/roles/run-tox/tasks/main.yaml
@@ -1,4 +1,4 @@
- name: Run tox
shell: "/usr/local/jenkins/slave_scripts/run-tox.sh {{ run_tox_envlist }}"
args:
- chdir: "/home/zuul/workspace/src/{{ zuul.project }}"
+ chdir: "{{ zuul_workspace_root }}/src/{{ zuul.project }}"
diff --git a/playbooks/tox-post.yaml b/playbooks/tox-post.yaml
index 697b727..3b035f8 100644
--- a/playbooks/tox-post.yaml
+++ b/playbooks/tox-post.yaml
@@ -3,7 +3,7 @@
- name: Find tox directories to synchrionize.
find:
file_type: directory
- paths: "/home/zuul/workspace/src/{{ zuul.project }}/.tox"
+ paths: "{{ zuul_workspace_root }}/src/{{ zuul.project }}/.tox"
# NOTE(pabelanger): The .tox/log folder is empty, ignore it.
patterns: ^(?!log).*$
use_regex: yes