git update hook to mcollective

Update: I’ve added some comments to the code examples, mostly around the mcollective stuff, to explain what happens on the other end. Might be useful for people who haven’t used mcollective.

With so many node.js hosting options in invite-only beta I grew frustrated and spent some time creating my own VM centric PaaS that would allow me to do heroku-style git push deployments to multiple nodes.

The result was nodokan. Putting it on the web as an invite-only beta is ironic.

Anyway, there’s a few things in there that might be of interest. I’m looking to drop the code onto Github eventually but I think I’d post up sanitised, illustrative only, versions of some of the stuff that’s in there in the hope that somebody will find particular parts useful.

First up, here’s a trick to have a git push to a remote repo upload a compressed git archive to s3 and then tell a set of machines connected to an mcollective bus to fetch and release that archive. Apologies for the eye-jarring switch from light-on-dark to dark-on-light.

First of all, the git hook

Next up, the upload script for s3

Finally, the script to call an agent living on specific target machines using mcollective

You would need the deployer mcollective agent on the other end. PuppetLabs have a tutorial for that.

CoffeeScript in Action

CoffeeScript in Action book cover

I'm the author. Get it from Manning.