Last active
June 12, 2023 09:43
-
-
Save Aricg/56f1a769cbdcbb93b459 to your computer and use it in GitHub Desktop.
Enable gerrit replication to github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gerrit version 2.8 | |
Replication plugin extracted from gerrit.war and installed over ssh | |
Installation method -> | |
a) Relevant configs: | |
/var/lib/gerrit/etc/replication.config | |
[remote "aricg-compliance"] | |
url = [email protected]:somerepo/${name}.git | |
push = +refs/heads/*:refs/heads/* | |
push = +refs/tags/*:refs/tags/* | |
timeout = 30 | |
threads = 3 | |
remoteNameStyle = dash | |
authGroup = GitHub Replication | |
/var/lib/gerrit/.ssh/config | |
Host github.com | |
User gerrit | |
IdentityFile /var/lib/gerrit/.ssh/id_rsa | |
StrictHostKeyChecking no | |
UserKnownHostsFile /dev/null | |
note: test sshing as the gerrit user to the remote server | |
b) Gerrit autorization: | |
Group Name: GitHub Replication | |
GitHub Replication denied read to refs/* in all projects | |
GitHub Replication allowed read to refs/* in in Project compliance/tests | |
c) enable plugin and start replication: | |
unzip gerrit.war | |
cp WEB-INF/plugins/replication.jar /tmp/ | |
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin install -n replication -</tmp/replication.jar | |
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin ls | |
Name Version Status File | |
------------------------------------------------------------------------------- | |
replication v2.8 ENABLED replication.jar | |
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin reload replication | |
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org replication start --wait --all | |
Replicate compliance/tests to aricgardner.com, Succeeded! | |
---------------------------------------------- | |
Replication completed successfully! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the doc!
Also for dumb like me: the gerrit docker has a java version which doesn't support new ssh_config file format so:
Match host github.com != Host github.com