Merge "Use ZUUL_SRC_PATH to pass the path to Zuul git sources" into stable/queens

This commit is contained in:
Zuul 2018-08-17 14:33:42 +00:00 committed by Gerrit Code Review
commit 0aff517768
2 changed files with 16 additions and 6 deletions

View File

@ -36,16 +36,22 @@
- name: Use Zuul provided sources in Zuul environment
block:
- name: Set Zuul sources path
set_fact:
zuul_src_path: "{{ lookup('env', 'ZUUL_SRC_PATH') }}"
- name: Check the Zuul src dir for cloned roles
stat:
path: "/home/zuul/src/{{ item.src.split('/')[-3:] | join('/') }}"
path: "{{ zuul_src_path }}/{{ item.src.split('/')[-3:] | join('/') }}"
get_attributes: no
get_checksum: no
get_mime: no
register: zuul_roles
when:
- item.scm == "git" or item.scm is undefined
with_items: "{{ required_roles }}"
- name: Link the Zuul provided roles
file:
src: "/home/zuul/src/{{ item.item.src.split('/')[-3:] | join('/') }}"
src: "{{ zuul_src_path }}/{{ item.item.src.split('/')[-3:] | join('/') }}"
dest: "{{ item.item.path | default(role_path_default) }}/{{ item.item.name | default(item.item.src | basename) }}"
state: link
owner: root
@ -54,7 +60,7 @@
| selectattr('stat.exists')
| list }}"
when:
- "lookup('env', 'ZUUL_PROJECT') != ''"
- "lookup('env', 'ZUUL_SRC_PATH') != ''"
- name: Clone git repos (with git)
git:

View File

@ -1,5 +1,9 @@
- hosts: all
tasks:
- name: Set the Zuul sources path
set_fact:
zuul_src_path: "{{ ansible_user_dir }}/src"
- name: Set current test repo (cross-repo)
set_fact:
current_test_repo: "git.openstack.org/{{ osa_test_repo }}"
@ -19,7 +23,7 @@
args:
chdir: "src/{{ current_test_repo }}"
environment:
# ZUUL_PROJECT is used by tests/get-ansible-role-requirements to
# determine when CI provided repos should be used.
ZUUL_PROJECT: "{{ zuul.project.short_name }}"
# ZUUL_SRC_PATH is used by tests/get-ansible-role-requirements to
# where the CI provided git sources were cloned.
ZUUL_SRC_PATH: "{{ zuul_src_path }}"
ANSIBLE_PACKAGE: "{{ ansible_package | default('') }}"