Also download roles/collections during the sync job

Since we're writing into a per-revision cache, we can do this easily now.
This commit is contained in:
Bill Nottingham
2020-06-02 11:39:35 -04:00
committed by AlanCoding
parent 1f4c46d873
commit 95e69124af
2 changed files with 10 additions and 16 deletions

View File

@@ -604,9 +604,8 @@ class ProjectUpdate(UnifiedJob, ProjectOptions, JobNotificationMixin, TaskManage
added_update_fields = [] added_update_fields = []
if not self.job_tags: if not self.job_tags:
job_tags = ['update_{}'.format(self.scm_type)] job_tags = ['update_{}'.format(self.scm_type)]
if self.job_type == 'run': job_tags.append('install_roles')
job_tags.append('install_roles') job_tags.append('install_collections')
job_tags.append('install_collections')
self.job_tags = ','.join(job_tags) self.job_tags = ','.join(job_tags)
added_update_fields.append('job_tags') added_update_fields.append('job_tags')
if self.scm_delete_on_update and 'delete' not in self.job_tags and self.job_type == 'check': if self.scm_delete_on_update and 'delete' not in self.job_tags and self.job_type == 'check':

View File

@@ -110,17 +110,14 @@
- update_svn - update_svn
- update_insights - update_insights
- hosts: localhost - name: Set content cache location
gather_facts: false set_fact:
connection: local cache_dir: "{{ project_cache }}/{{ scm_version|default(scm_branch) }}"
name: Install content with ansible-galaxy command if necessary tags:
tasks: - install_collections
- install_roles
- block: - block:
- name: set content cache location
set_fact:
cache_dir: "{{ project_cache }}/{{ scm_branch }}"
- name: detect requirements.yml - name: detect requirements.yml
stat: stat:
path: '{{project_path|quote}}/roles/requirements.yml' path: '{{project_path|quote}}/roles/requirements.yml'
@@ -141,16 +138,13 @@
synchronize: synchronize:
src: "{{ cache_dir }}/requirements_roles" src: "{{ cache_dir }}/requirements_roles"
dest: "{{ roles_destination }}" dest: "{{ roles_destination }}"
when: roles_destination is defined
when: roles_enabled|bool when: roles_enabled|bool
tags: tags:
- install_roles - install_roles
- block: - block:
- name: set content cache location
set_fact:
cache_dir: "{{ project_cache }}/{{ scm_branch }}"
- name: detect collections/requirements.yml - name: detect collections/requirements.yml
stat: stat:
path: '{{project_path|quote}}/collections/requirements.yml' path: '{{project_path|quote}}/collections/requirements.yml'
@@ -172,6 +166,7 @@
synchronize: synchronize:
src: "{{ cache_dir }}/requirements_collections" src: "{{ cache_dir }}/requirements_collections"
dest: "{{ collections_destination }}" dest: "{{ collections_destination }}"
when: collections_destination is defined
when: when:
- "ansible_version.full is version_compare('2.8', '>=')" - "ansible_version.full is version_compare('2.8', '>=')"