Skip to content

Commit 9740d54

Browse files
committed
health-check: use the resources backend instead of managesf
Story: 57 Task: 167 Change-Id: I0f2137140645db67ee6f864cbd3ca4ea2eb7a583
1 parent fd69d88 commit 9740d54

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

playbooks/managesf_project_create.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,30 @@
1818
- "git reset --hard origin/master --"
1919
when: p.stat.isdir is defined and p.stat.isdir == True
2020

21-
- name: Create project with managesf
22-
command: "sfmanager --auth admin:{{ authentication.admin_password }} --url http://{{ fqdn }} project create --name {{ project }}"
21+
- name: "Reset config repos"
22+
include: config_reset.yaml
23+
when: p.stat.isdir is not defined
24+
25+
- hosts: install-server
26+
tasks:
27+
- name: Create project with the resources backend
28+
template: src=../templates/project-resource.yaml.j2 dest=/root/config/resources/project-resource-{{ project }}.yaml
2329
when: p.stat.isdir is not defined
2430

31+
- name: Commit change
32+
command: chdir=/root/config {{ item }}
33+
with_items:
34+
- 'git add resources/project-resource-{{ project }}.yaml'
35+
- 'git commit -a -m "Add {{ project }} to resources"'
36+
environment: {'EDITOR':'test'}
37+
when: p.stat.isdir is not defined
38+
39+
- name: "Submit config repos"
40+
include: config_submit_change.yaml
41+
when: p.stat.isdir is not defined
42+
43+
- hosts: install-server
44+
tasks:
2545
- name: Checkout project
2646
git: repo=http://{{ fqdn }}/r/{{ project }} dest={{ project_path }}
2747
when: p.stat.isdir is not defined

templates/project-resource.yaml.j2

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
resources:
2+
projects:
3+
{{ project }}:
4+
description: The project {{ project }}
5+
issue-tracker: SFStoryboard
6+
source-repositories:
7+
- {{ project }}
8+
repos:
9+
{{ project }}:
10+
description: The git repository {{ project }}
11+
acl: config-acl
12+
acls:
13+
{{ project }}-acl:
14+
file: |
15+
[access "refs/*"]
16+
read = group {{ project }}-core
17+
owner = group {{ project }}-ptl
18+
[access "refs/heads/*"]
19+
label-Code-Review = -2..+2 group {{ project }}-core
20+
label-Code-Review = -2..+2 group {{ project }}-ptl
21+
label-Verified = -2..+2 group {{ project }}-ptl
22+
label-Workflow = -1..+1 group {{ project }}-core
23+
label-Workflow = -1..+1 group {{ project }}-ptl
24+
label-Workflow = -1..+0 group Registered Users
25+
submit = group {{ project }}-ptl
26+
read = group {{ project }}-core
27+
read = group Registered Users
28+
[access "refs/meta/config"]
29+
read = group {{ project }}-core
30+
read = group Registered Users
31+
[receive]
32+
requireChangeId = true
33+
[submit]
34+
mergeContent = false
35+
action = fast forward only
36+
groups:
37+
- {{ project }}-ptl
38+
- {{ project }}-core
39+
groups:
40+
{{ project }}-ptl:
41+
description: Team lead for the {{ project }} repo
42+
members:
43+
44+
{{ project }}-core:
45+
description: Team core for the {{ project }} repo
46+
members: []

0 commit comments

Comments
 (0)