infra/codestorage/hg-ssh

Paddy 2015-10-14 Child:1b1ca7817a10

2:121585c71fd7 Go to Latest

infra/codestorage/hg-ssh/hgrc

Update to broadcast pushes to all our web frontends. We'll need dig, so install that when we apt-get. Fix a typo in the hashbang line for create_user.sh Add an hgrc file that goes in /etc/mercurial/hgrc to add the changegroup.fe_publish hook to all our repos. Basically, any time we get a change on disk, that automatically gets propagated out to all the frontend using our post-commit-broadcast.sh script. Write the aforementioned post-commit-broadcast.sh script. This basically finds the repo we're in (by stripping known prefixes), then uses dig to compile a list of web frontends. Finally, for each web frontend, we do an hg push over http. Not so hard, but it means all our web frontends are kept recent. This has a few shortcomings. I don't think it will work when starting a new repo; I think we need to wait for hg-repo-sync to back that up, then the web frontend to pull from backups. Another possibility is that we push, then stand up a new front end before the push makes it into the backups. The frontend then won't have that push until it pulls again from backups. These are rare, minutes-long windows where we're out of sync, so I'm really ok with these failure modes.

History
paddy@2 1 [hooks]
paddy@2 2 changegroup.fe_publish = /usr/local/bin/helpers/broadcast-to-frontends.sh