README.md
1# ChromeOS Project Admin Tools
2
3This directory contains tools used by admin users to create and manage
4programs and projects. Regular users should not need to use these tools.
5
6The tools in this directory include (described in more detail below):
7
8* `create_partner_repo`: This script does the heavy lifting in creating
9 new programs and projects. It creates the repos, sets ACLs, makes
10 necessary manifest changes, etc.
11* `gen_project`: This script puts the basic skeleton of files and symlinks
12 in place when starting a new program and project. It is intended to
13 bootstrap the process and lay things out in an idiomatic way.
14
15## `create_partner_repo`
16
17The script creates partner program or project git repos, gerrit groups, and
18applies ACLs to both the repos and groups. The script is idempotent and can be
19re-run as many times as you wish:
20
21* The
22 [Gerrit Rest](https://gerrit-review.googlesource.com/Documentation/rest-api.html)
23 and
24 [gob-ctl](https://g3doc.corp.google.com/company/teams/gerritcodereview/users/gob-ctl.md#create-a-git-repository)
25 apis check if repo and gerrit groups exist.
26* ACLs can be re-applied without any side affects.
27* Creation of local_manifest step will be skipped if one already exists.
28* Creation and ACL setting on already existing gs buckets is a noop.
29
30### Requirements :
31
321. The script runner needs to be added to group
33 [mdb/chrome-git-admins](https://ganpati.corp.google.com/chrome-git-admins).
34 Request to be added should go to
35 [mdb/chrome-git-admins-ninja](https://ganpati.corp.google.com/chrome-git-admins-ninja).
362. The script runner needs to get added to the gerrit group
37 [chromeos-partner-admins](https://chrome-internal-review.googlesource.com/admin/groups/23).
38 Request to be added can be made to any member of chromeos-partner-admins.
393. Install jq for json file parsing. \
40 `$ sudo apt-get install jq`
41
42### How to run the script
43
44For a new program, manually create a {program}\_local_manifest.xml file and
45commit to this script's directory. That local_manifest with get copied to all
46project repos in the program.
47
48To add resources for a program \
49`$ ./create_partner_repo --program programName`
50
51To add resource for a project \
52`$ ./create_partner_repo --program programName --project projectName`
53
54To apply ACLs to project's committer and access groups (--project is optional) \
55`$ ./create_partner_repo --program programName --project projectName --run
56acls`
57
58To create and apply default permissions to gerrit groups (--project is optional)
59\
60`$ ./create_partner_repo --program programName --project projectName --run
61gerritgroups`
62
63To add a local_manifest.xml into the project repo \
64`$ ./create_partner_repo --program programName --project projectName --run
65localmanifest`
66
67To create gs buckets and assign ACLs to them \
68`$ ./create_partner_repo --program programName --project projectName --run
69createprojectbuckets`
70
71## `gen_project`
72
73TODO
74