Revert "Move to dictionary list of projects zuul._projects"

This reverts commit df98773573.

The order in which we iterate over items in the "determine local HEAD"
task is not always the order in which we iterate over mirror-workspace-
git-repos.

Change-Id: I181d6a2cfa2c3104730f20362bbdc10fa582339f
This commit is contained in:
James E. Blair 2017-10-29 10:36:37 -07:00
parent fa896e2125
commit f28cc33bc3
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.value.src_dir}}"
with_dict: "{{ zuul._projects }}"
repo: "{{ ansible_user_dir }}/{{ item.src_dir}}"
with_items: "{{ zuul.projects }}"
- name: Synchronize src repos to workspace directory
command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.value.src_dir}}"
command: "git push --mirror git+ssh://{{ ansible_user }}@{{ ansible_host }}/{{ ansible_user_dir }}/{{ item.src_dir}}"
args:
chdir: "{{ zuul.executor.work_root }}/{{ item.value.src_dir }}"
with_dict: "{{ zuul._projects }}"
chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}"
with_items: "{{ 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.value.src_dir }}"
with_dict: "{{ zuul._projects }}"
chdir: "{{ zuul.executor.work_root }}/{{ item.src_dir }}"
with_items: "{{ 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 }}/{{ zuul._projects.get(item.0).src_dir }}"
chdir: "{{ ansible_user_dir }}/{{ 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.values() | selectattr('required') | list }}"
projects: "{{ zuul.projects | selectattr('required') | list }}"
when: tox_install_siblings