2019年10月1日 星期二

Get and push AOSP projects to local Gerrit server

1. Get Git MIRROR from AOSP
$ mkdir aosp_mirror
$ repo init -u https://android.googlesource.com/platform/manifest --mirror
$ repo sync


2. Create a project as parent in Gerrit of all other AOSP projects
2.a. In Gerrit Web UI, Browse->Repositories-> Create New
2.b. Set "Only server as parent for other repositories" to true


3. Create groups to manage access of your project
3.a. Browse->Groups->Create New
3.b. Create 2 groups, android10-admin, android10-user


4. Add your group to access Android10 project
4.a. Browse->Repository->AOSP
4.b. Click access on left tab
4.c. Modify it as you want


5. Add projects to Gerrit
5.a. Add projects to Gerrit
$ repo forall -c 'echo $REPO_PROJECT; ssh -p 29418 admin@10.10.10.10 gerrit create-project --owner android10-admin Android10/$REPO_PROJECT;'

5.b. Add parent project of added projects
$ repo forall -c 'echo $REPO_PROJECT; ssh -p 29418 admin@10.10.10.10 gerrit set-project-parent --parent AOSP Android10/$REPO_PROJECT;' 

沒有留言:

張貼留言