Skip to content

Instantly share code, notes, and snippets.

@yukoff
Forked from Aricg/gist:56f1a769cbdcbb93b459
Created February 22, 2016 09:54
Show Gist options
  • Save yukoff/bcdb67811de911f7db92 to your computer and use it in GitHub Desktop.
Save yukoff/bcdb67811de911f7db92 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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment