Merge "Fix errors in use-cache-repos"

This commit is contained in:
Jenkins 2017-08-30 14:56:05 +00:00 committed by Gerrit Code Review
commit 896af6639f
1 changed files with 6 additions and 3 deletions

View File

@ -6,7 +6,8 @@
- name: Clone cached repo to workspace
command: "git clone /opt/git/{{ item.0.name }} {{ ansible_user_dir }}/{{ item.0.src_dir}}"
creates: "{{ ansible_user_dir }}/{{ item.0.src_dir}}"
args:
creates: "{{ ansible_user_dir }}/{{ item.0.src_dir}}"
when: item.1.stat.exists
with_together:
- "{{ zuul.projects }}"
@ -14,7 +15,8 @@
- name: Clone upstream repo to workspace
command: "git clone https://{{ item.0.canonical_hostname }}/{{ item.0.name}} {{ ansible_user_dir }}/{{ item.0.src_dir}}"
creates: "{{ ansible_user_dir }}/{{ item.0.src_dir}}"
args:
creates: "{{ ansible_user_dir }}/{{ item.0.src_dir}}"
when: not item.1.stat.exists
with_together:
- "{{ zuul.projects }}"
@ -22,5 +24,6 @@
- name: Remove origin from local git repos
command: "git remote rm origin"
chdir: "{{ ansible_user_dir }}/{{ item.src_dir}}"
args:
chdir: "{{ ansible_user_dir }}/{{ item.src_dir}}"
with_items: "{{ zuul.projects }}"