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>
This commit is contained in:
Paul Belanger 2017-03-03 14:49:17 -05:00
parent 989b03c4c6
commit 01be2d6a46
9 changed files with 12 additions and 13 deletions

View File

@ -5,6 +5,8 @@
success-url: http://zuulv3-dev.openstack.org/logs/{build.uuid}/
failure-url: http://zuulv3-dev.openstack.org/logs/{build.uuid}/
timeout: 1800
vars:
zuul_workspace_root: /home/zuul
nodes:
- name: ubuntu-xenial
image: ubuntu-xenial

View File

@ -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

View File

@ -1,3 +0,0 @@
---
# tasks/main.yaml
prepare_workspace_root: /home/zuul/workspace

View File

@ -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 }}"

View File

@ -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 }}"

View File

@ -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 }}"

View File

@ -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 }}"

View File

@ -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 }}"

View File

@ -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