blob: 475d6770f5929ed9ce490d1bef66fdc22a49d248 [file] [log] [blame]
Jan Kundrát4552bf42019-02-13 19:39:43 +01001- hosts: all
2 tasks:
3
4 - name: Point the "origin" git remote to its filesystem location
5 shell: git config --get remote.origin.url > /dev/null && git config remote.origin.url "{{ ansible_user_dir }}/{{ item.src_dir}}" || true
6 args:
7 chdir: "{{ ansible_user_dir }}/{{ item.src_dir}}"
8 with_items: "{{ zuul.projects.values() | list }}"
9
10 # E.g. Boost uses submodule URLs which end with a .git trailing suffix.
11 # That happens to be handled by many git servers automagically.
12 # Instead of rewriting the submodule URLs within each repo (which would either mark
13 # the repo dirty, or change its hash), use a big hammer and provide these
14 # "compatibility" repository names.
15 # If both a `repo` and `repo.git` already exist, then we're screwed.
16 - name: Prepare path/to/foo.git repository aliases for each path/to/foo repository
17 file:
18 src: "{{ ansible_user_dir }}/{{ item.src_dir}}"
19 dest: "{{ ansible_user_dir }}/{{ item.src_dir}}.git"
20 state: link
21 with_items: "{{ zuul.projects.values() | list }}"
22
23 - name: Recursively prepare git submodules of the main project
24 shell: git submodule update --init --recursive
25 args:
26 chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir}}"
27
28 - name: Set the "origin" git remote back to Zuul's fake /dev/null
29 shell: git config --get remote.origin.url > /dev/null && git config remote.origin.url file:///dev/null || true
30 args:
31 chdir: "{{ ansible_user_dir }}/{{ item.src_dir}}"
32 with_items: "{{ zuul.projects.values() | list }}"