我想配置从Gerrit到GitLab的复制。对于“商业”项目,它工作得很好。但对于“默认”用户(所有项目和所有用户)来说,这是行不通的。“业务”项目名称与Gerrit和GitLab格式的“组/项目”相同。
我的replication.config文件:
[gerrit]
autoReload = true
replicateOnStartup = true
[remote "GitLab-All-Projects"]
projects = All-Projects
url = gitlab@gitlab.local:external-tools/gerrit-All-Projects.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
threads = 3
mirror = true
[remote "GitLab"]
url = gitlab@gitlab.local:${name}.git
push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
threads = 3我对remote "GitLab-All-Projects"有意见。来自replication_log
[2021-10-22 19:57:46,038] Replication to gitlab@gitlab.local:All-Projects.git started... [CONTEXT pushOneId="7656717c" ]
[2021-10-22 19:57:46,303] Replication to gitlab@gitlab.local:All-Users.git started... [CONTEXT pushOneId="b6794909" ]
[2021-10-22 19:57:47,027] Created remote repository: gitlab@gitlab.local:All-Projects.git [CONTEXT pushOneId="7656717c" ]
[2021-10-22 19:57:47,027] Missing repository created; retry replication to gitlab@gitlab.local:All-Projects.git [CONTEXT pushOneId="7656717c" ]
[2021-10-22 19:57:47,295] Created remote repository: gitlab@gitlab.local:All-Users.git [CONTEXT pushOneId="b6794909" ]
[2021-10-22 19:57:47,296] Missing repository created; retry replication to gitlab@gitlab.local:All-Users.git [CONTEXT pushOneId="b6794909" ]当然,在GitLab中没有像GitLab这样的回购。但是有gitlab.local:external-tools/gerrit-All-Projects.git,用于复制的用户具有主级别的权限。
当我试图检查复制状态时,下面是我得到的信息:
$ ssh -p 29418 user@gerrit.local replication list --detail --json
{"Remote":"GitLab-All-Projects","Url":["gitlab@gitlab.local:external-tools/gerrit-All-Projects.git"],"Project":["All-Projects"]}
{"Remote":"GitLab","Url":["gitlab@gitlab.local:${name}.git"],"Pending":["(retry 1) [b6794909] push gitlab@gitlab.local:All-Users.git [..all..]","(retry 1) [7656717c] push gitlab@gitlab.local:All-Projects.git [..all..]"]}我想:
remote "GitLab-All-Projects"中为所有项目和所有用户配置复制。remote "GitLab"中所有项目和所有用户的复制(以保持日志干净)发布于 2021-11-03 12:43:23
您可以按以下方式修改您的replication.config:
[gerrit]
autoReload = true
replicateOnStartup = true
[remote "GitLab-All-Projects"]
projects = All-Projects
projects = All-Users
url = gitlab@gitlab.local:external-tools/gerrit-${name}.git
push = +refs/*:refs/*
threads = 3
mirror = true
[remote "GitLab"]
projects = ^(?:(?!All-(Users|Projects)).)*$
url = gitlab@gitlab.local:${name}.git
push = +refs/*:refs/*
threads = 3来自插件文档:remote.NAME.projects : Specifies which repositories should be replicated to the remote. It can be provided more than once, and supports three formats: regular expressions, wildcard matching, and single project matching. All three formats match case-sensitive.
请记住,All-*项目不一定包含refs/heads命名空间下的refs,因此您必须复制refs/*。见下面的例子:
> pwd
/tmp/gerrit/git/All-Projects.git
> git show-ref
4c160a51808ec7ec253f125ea404c96302292940 refs/meta/config
56a6051ca2b02b04ef92d5150c9ef600403cb1de refs/sequences/changes
> pwd
/tmp/gerrit/git/All-Users.git
> git show-ref
14711668d99dc83834cf2a83e6f3416bb1059321 refs/groups/5a/5a1e63b3d5542f55a25adaf390ca745b4335d995
fdb77a3da3fbe131936161768c38f5d78deb54bd refs/groups/f7/f7ff10a4c7d8b4c3004f843fccdb2ca8decdc330
278491ec14ecd9d856f194c0a3cc8e571a040bda refs/meta/config
e2bc4638a57a79d63647a070a9fefcaed7628bae refs/meta/external-ids
35a98b786adba41afb255a3b831d0bfaf62ac61f refs/meta/group-names
44b2d5628ae9a825b22c86ed14f0ce6335ea888b refs/sequences/accounts
e440e5c842586965a7fb77deda2eca68612b1f53 refs/sequences/groups
c2e273e2356165687fa722fd938a0aeee3f5261e refs/users/00/1000000https://stackoverflow.com/questions/69681356
复制相似问题