summaryrefslogtreecommitdiff
path: root/README.mdwn
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-11 11:35:49 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-03-13 15:14:29 +0000
commit3bf92ba17b00f6b50e423415cdc9a6b807f74c5c (patch)
tree40b915d0180f1a6c5539eb6a9ebc4ec31380f71d /README.mdwn
parenta3d7604896898a0d1e2728eed9bbad344838551c (diff)
downloadinfrastructure-3bf92ba17b00f6b50e423415cdc9a6b807f74c5c.tar.gz
gerrit: Add mirroring configuration
This pulls from git.baserock.org with lorry-controller, and pushes 'master' back to git.baserock.org using gerrit-replication.
Diffstat (limited to 'README.mdwn')
-rw-r--r--README.mdwn59
1 files changed, 57 insertions, 2 deletions
diff --git a/README.mdwn b/README.mdwn
index 9d77055b..f678e8de 100644
--- a/README.mdwn
+++ b/README.mdwn
@@ -250,6 +250,11 @@ appear for some reason, or it might not work at all. Click off the page and
come back to it and it might suddenly have appeared. I've not investigated why
this happens.
+Generate the SSH keys you need, if you don't have them.
+
+ mkdir -p keys
+ ssh-keygen -t rsa -b 4096 -C 'lorry@gerrit.baserock.org' -N '' -f keys/lorry-gerrit.key
+
Now set up the Gerrit access configuration. You'll need to have cloned
<https://github.com/ssssam/ansible-gerrit> alongside infrastructure.git, and ran
`make` in that directory. You'll also need 'pygerrit' installed somewhere
@@ -278,12 +283,62 @@ which will be needed in the next step.
#### Mirroring
-TO DO: link to document on setting up mirroring.
-
Run:
ansible-playbook -i hosts baserock_gerrit/instance-mirroring-config.yml
+Now clone the lorry-controller configuration repository, commit the
+configuration file to it, and push.
+
+ git clone ssh://$GERRIT_ADMIN_USERNAME@gerrit.baserock.org:29418/local-config/lorries.git /tmp/lorries
+ cp baserock_gerrit/lorry-controller.conf /tmp/lorries
+ cd /tmp/lorries
+ git checkout -b master
+ git add .
+ git commit -m "Add initial Lorry Controller mirroring configuration"
+ git push origin master
+ cd -
+
+Now SSH in as 'root' to gerrit.baserock.org, tunnelling the lorry-controller
+webapp's port to your local machine:
+
+ ssh -L 12765:localhost:12765 root@gerrit.baserock.org
+
+Visit <http://localhost/1.0/status-html>. You should see the lorry-controller
+status page. Click 'Re-read configuration', if there are any errors in the
+configuration it'll tell you. If not, it should start mirroring stuff from
+your Trove.
+
+Create a Gitano account on the Trove you want to push changes to for the Gerrit
+user. The `instance-config.yml` Ansible playbook will have generated an SSH
+key. Do this on the Gerrit instance.
+
+ ssh git@git.baserock.org user add gerrit "gerrit.baserock.org" gerrit@baserock.org
+ ssh git@git.baserock.org as gerrit sshkey add main < ~gerrit/.ssh/id_rsa.pub
+
+Add the user to the necessary -writers groups, so they can push updates to the
+repos. The 'replication.config' file controls what the gerrit-replication plugin
+tries to push. By default force-push is disabled and only 'master' and tags are
+pushed.
+
+ ssh git@git.baserock.org group adduser baserock-writers gerrit
+
+Add the host key of the remote trove.
+
+ sudo -u gerrit sh -c 'ssh-keyscan git.baserock.org >> ~gerrit/.ssh/known_hosts'
+
+Check the account is working.
+
+ sudo -u gerrit ssh git@git.baserock.org whoami
+
+Now enable the gerrit-replication plugin, check that it's now in the list of
+plugins, and manually start a replication cycle. You should see log output from
+the final SSH command showing any errors.
+
+ ssh $GERRIT_ADMIN_USERNAME@gerrit.baserock.org -p 29418 gerrit plugin enable replication
+ ssh $GERRIT_ADMIN_USERNAME@gerrit.baserock.org -p 29418 gerrit plugin ls
+ ssh $GERRIT_ADMIN_USERNAME@gerrit.baserock.org -p 29418 replication start --all --wait
+
### Storyboard
We use a slightly adapted version of