mozilla/shove — pull request #1 by lonnen (2013-07-28 07:48:44+00:00)
Title: wip - first draft

took a first cut at this tonight. code doesn't work yet, but I don't know when I'll come back to it. If this line of inquiry is interesting, grab my branch and keep going. Currently it errors out trying to establish a RabbitMQ connection. Anyhow, here's the general idea:

`setup.py install` will install a `shove` executable into your path. All configuration comes from the environment. It will try to connect to RabbitMQ, and in `while(True)` make a blocking read that waits for something and then grabs it. When an item is received it will execute the command as a subprocess using honcho, a python rewrite of foreman. The whole thing can be run by a process monitor (upstart, etc).

Blocking reads prevent concurrent pushes from fatally interacting. Running things directly from the queue might be a terrible idea, but its simpler to implement so I've started with it.. Alternatively we could try using a Procfile to define possible commands with an alias ( `deploy: deploy_command.sh -p 000`) and push the aliases through the queue. We can leverage Honcho a little further to handle parsing the doc, etc. I've set RabbitMQ read not to wait for an ack, since the command may fail and I don't want failing commands to retry 'processing' over and over. However, we could probably do better with piping the job output back to the Captain. Right now that's all going to std out and err. It should probably, minimally, go into the log.