Browse Source

Generate a filtered list of git repos to clone

This change creates a list of repos that are unconditionally
cloned. The list is available for a future parallel git clone
ansible module to consume.

Change-Id: If7c0b06124cfc11775ce38c900e076e3cf9b69d8
Jonathan Rosser 8 months ago
parent
commit
546c4fc1f7
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      tasks/repo_clone_git.yml

+ 10
- 5
tasks/repo_clone_git.yml View File

@@ -31,6 +31,15 @@
31 31
     src: "{{ repo_build_release_path }}/requirements.txt"
32 32
   register: slurp_requirements
33 33
 
34
+- name: Build filtered list of repos to clone
35
+  set_fact:
36
+     _repo_build_git_clone_list: "{{ _repo_build_git_clone_list | default([]) + [ item ] }}"
37
+  with_items: "{{ local_packages.results.0.item.remote_package_parts }}"
38
+  when: >
39
+    (not repo_build_git_selective | bool) or
40
+    (item['name'] in slurp_requirements.content | b64decode | splitlines) or
41
+    ((groups[item['project_group']] is defined) and (groups[item['project_group']] | length > 0))
42
+
34 43
 - name: Clone git repositories
35 44
   become: yes
36 45
   become_user: "{{ repo_build_service_user_name }}"
@@ -41,11 +50,7 @@
41 50
     version: "{{ item['version'] }}"
42 51
     depth: "{{ repo_build_git_depth }}"
43 52
     force: yes
44
-  with_items: "{{ local_packages.results.0.item.remote_package_parts }}"
45
-  when: >
46
-    (not repo_build_git_selective | bool) or
47
-    (item['name'] in slurp_requirements.content | b64decode | splitlines) or
48
-    ((groups[item['project_group']] is defined) and (groups[item['project_group']] | length > 0))
53
+  with_items: "{{ _repo_build_git_clone_list }}"
49 54
   register: _git_clone
50 55
   until: _git_clone  is success
51 56
   delay: 5

Loading…
Cancel
Save