Move to dictionary list of projects zuul._projects

Zuul exports the projects list as a dictionary in _projects in the
depends-on.  The idea is that we switch these jobs to that, and do
some testing.  When ready, we switch "projects" to be the dictionary
view, and revert "_project" calls here to "project".

Change-Id: Id9a7c137ca5bed25d81087201091157c8401576a
Depends-On: I4476b9d4915d107e29b91229287865bff0ada305
This commit is contained in:
Ian Wienand 2017-10-19 13:58:39 +11:00 committed by Andreas Jaeger
parent c7c56a580e
commit df98773573
2 changed files with 10 additions and 10 deletions

View File

@ -3,14 +3,14 @@
name: receive.denyCurrentBranch ignore
value: ignore
scope: local
repo: "{{ ansible_user_dir }}/{{ item.src_dir}}"
with_items: "{{ zuul.projects }}"
repo: "{{ ansible_user_dir }}/{{ item.value.src_dir}}"
with_dict: "{{ zuul._projects }}"
- name: Synchronize src repos to workspace directory
command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.src_dir}}"
command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.value.src_dir}}"
args:
chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}"
with_items: "{{ zuul.projects }}"
chdir: "{{ zuul.executor.work_root }}/{{ item.value.src_dir }}"
with_dict: "{{ zuul._projects }}"
delegate_to: localhost
# ANSIBLE0006: Skip linting since it triggers on the "git" command,
# but push is not supported by ansible git module.
@ -20,8 +20,8 @@
- name: Determine local HEAD
shell: "git status |head -1 |awk '{ print $NF }'"
args:
chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}"
with_items: "{{ zuul.projects }}"
chdir: "{{ zuul.executor.work_root }}/{{ item.value.src_dir }}"
with_dict: "{{ zuul._projects }}"
delegate_to: localhost
register: statuses
# ANSIBLE0006: Skip linting since it triggers on the "git" command,
@ -39,9 +39,9 @@
# checkout the branch matching the branch set up by the executor
git checkout {{ item.1.stdout }}
args:
chdir: "{{ ansible_user_dir }}/{{ item.0.src_dir }}"
chdir: "{{ ansible_user_dir }}/{{ zuul._projects.get(item.0).src_dir }}"
with_together:
- "{{ zuul.projects }}"
- "{{ zuul._projects }}"
- "{{ statuses.results }}"
# ANSIBLE0006: Skip linting since it triggers on the "git" command,
# but we prefer the shell above

View File

@ -15,5 +15,5 @@
tox_envlist: "{{ tox_envlist }}"
tox_constraints_file: "{{ tox_constraints_file | default(omit) }}"
project_dir: "{{ zuul_work_dir }}"
projects: "{{ zuul.projects | selectattr('required') | list }}"
projects: "{{ zuul._projects.values() | selectattr('required') | list }}"
when: tox_install_siblings