-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfigure_repository.yml
More file actions
61 lines (55 loc) · 2.62 KB
/
Copy pathconfigure_repository.yml
File metadata and controls
61 lines (55 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
- name: Print repository manifest
ansible.builtin.debug:
var: repository_manifest
- name: Clone repository # noqa latest[git]
ansible.builtin.git:
repo: "https://{{ owner }}:$GITHUB_TOKEN@github.com/{{ owner }}/{{ repository_manifest.name }}.git"
dest: "{{ staging_path }}/{{ repository_manifest.name }}"
# Don't clone submodules.
recursive: false
- name: Get default branch name # noqa command-instead-of-module
ansible.builtin.command:
cmd: git rev-parse --abbrev-ref HEAD
chdir: "{{ staging_path }}/{{ repository_manifest.name }}"
register: default_branch_name
changed_when: false
- name: Add workflows to default branch
ansible.builtin.include_tasks: tasks/add_workflows.yml
vars:
workflow_manifest:
branch: "{{ default_branch_name.stdout }}"
workflows: "{{ repository_manifest.workflows.default_branch_only }}"
workflow_args: "{{ repository_manifest.workflow_args }}"
when:
- repository_manifest.copy_workflows | bool
- not default_branch_name.stdout.startswith('stackhpc/') or default_branch_name.stdout[9:] not in repository_manifest.releases | default([])
- name: Add workflows to supported releases
ansible.builtin.include_tasks: tasks/add_workflows.yml
vars:
workflow_manifest:
branch: "{{ branch_name }}"
prefix: "stackhpc/"
workflows: >-
{{ repository_manifest.workflows.elsewhere
| difference(repository_manifest.workflows.per_release_ignored_workflows[branch_name | string] | default([])) }}
workflow_args: "{{ repository_manifest.workflow_args }}"
when: repository_manifest.copy_workflows and repository_manifest.releases is defined
with_items: "{{ repository_manifest.releases }}"
loop_control:
loop_var: branch_name
- name: Add community files to default branch
ansible.builtin.include_tasks: tasks/add_community_files.yml
vars:
community_manifest: { branch: "{{ default_branch_name.stdout }}", community_files: "{{ repository_manifest.community_files }}" }
when:
- repository_manifest.community_files is defined
- not default_branch_name.stdout.startswith('stackhpc/') or default_branch_name.stdout[9:] not in repository_manifest.releases | default([])
- name: Add community files to supported releases
ansible.builtin.include_tasks: tasks/add_community_files.yml
vars:
community_manifest: { branch: "{{ branch_name }}", prefix: "stackhpc/", community_files: "{{ repository_manifest.community_files }}" }
when: repository_manifest.community_files is defined and repository_manifest.releases is defined
with_items: "{{ repository_manifest.releases }}"
loop_control:
loop_var: branch_name