Skip to content

Instantly share code, notes, and snippets.

@Aricg
Last active June 12, 2023 09:43
Show Gist options
  • Save Aricg/56f1a769cbdcbb93b459 to your computer and use it in GitHub Desktop.
Save Aricg/56f1a769cbdcbb93b459 to your computer and use it in GitHub Desktop.
Enable gerrit replication to github
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!
@hlopezvg
Copy link

hlopezvg commented Jul 8, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment