fabric: a good assistant for the development of WaterOnMars
Despite spending currently more time using my WaterOnMars feed reader than developing it, I'm still making small improvements to it. And to make my life easier I could count on a solid little project: fabric !
fabric is a Python based command-line utility designed to help running commands remotely: typically to deploy a web app on a remote server.
So I'm using it to deploy WaterOnMars on my personal server and also to deploy the demo version on heroku. But more recently I added fabric's configuration file (the "fabfile") to the sources of the project as an officially maintained helper for development tasks ((well I didn't think of it in such a formal way obviously)). It's now usable to run the test suite, to launch the web app locally, to set-up the db and to deploy it on custom servers.
What I really like with fabric:
And more details are available in WaterOnMars's fabfile.py of course.
- it's easily installable with pip, in a virtualenv if needed and bam! fabric's command line "fab" is immediately available on console
- it's easily configurable with a single Python file
- I had absolutely no problem in using it for remote actions ((credential prompts, log collection and console interaction are perfectly well handled))
- it can also easily be used to define local commands
[{userA}@{hostX}] site_dir = ~/path/to/wateronmars_site virtual_env_dir = ../venv final_deploy_action = touch /path/to/passenger/tmp/restart.txt