Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • schober-ansible/collections/cschober.mygit
1 result
Show changes
Commits on Source (2)
#SPDX-License-Identifier: MIT-0
# SPDX-License-Identifier: MIT-0
---
# defaults file for group_project
project_names: []
parent_group: "{{ projects_root_group }}/{{ module.name }}"
group: "{{ parent_group }}/{{ module.term }}"
......@@ -16,14 +16,19 @@
# state: absent
- name: "Create project facts"
ansible.builtin.set_fact:
project_names: "{{ project_names + [group + '/' + item[0].name + '-' + item[1].repo_name] }}"
project_names: >-
{{ project_names + [
group + '/' +
item[0].name +
('-' + item[1].repo_name if item[1].repo_name is defined and item[1].repo_name | length > 0 else '')
] }}
loop: "{{ module.teams | product(module.repo_config) | list }}"
- name: "Print full project paths "
ansible.builtin.debug:
var: project_names
- name: "Create projects"
community.general.gitlab_project:
name: "{{ item[0].name }}-{{ item[1].repo_name }}"
name: "{{ item[0].name }}{{ '-' ~ item[1].repo_name if item[1].repo_name is defined else '' }}"
group: "{{ group }}"
initialize_with_readme: false
import_url: "{{ item[1].import_url | default('https://mygit.th-deg.de/schober-public/templates/student-repo.git') }}"
......@@ -32,7 +37,7 @@
loop: "{{ module.teams | product(module.repo_config) | list }}"
- name: "Set branch protection level"
community.general.gitlab_protected_branch:
project: "{{ group }}/{{ item[0].name }}-{{ item[1].repo_name }}"
project: "{{ group }}/{{ item[0].name }}{{ '-' ~ item[1].repo_name if item[1].repo_name is defined else '' }}"
name: main
merge_access_levels: "{{ item[1].merge_access_levels }}"
push_access_level: "{{ item[1].push_access_level }}"
......@@ -41,7 +46,7 @@
loop: "{{ module.teams | product(module.repo_config) | list }}"
- name: "Invite user"
cschober.mygit.gitlab_invitation:
gitlab_project: "{{ group }}/{{ item[0].name }}-{{ item[1].repo_name }}"
gitlab_project: "{{ group }}/{{ item[0].name }}{{ '-' ~ item[1].repo_name if item[1].repo_name is defined else '' }}"
email: "{{ item[0].users }}"
state: present
access_level: "{{ item[1].access_level }}"
......
#SPDX-License-Identifier: MIT-0
---
# vars file for group_project
project_names: []
gitlab_api_url:
gitlab_api_token:
projects_root_group: schober-teaching/student-projects
parent_group: "{{ projects_root_group }}/{{ module.name }}"
group: "{{ parent_group }}/{{ module.term }}"
module:
name:
term:
repo_config:
- repo_name:
import_url:
access_level: developer
merge_access_levels: developer
push_access_level: developer
teams:
- name:
users: