Showing posts from February, 2013

Automating everyday system routine with Fabric (Python)

Lets talk about your console work. I use it on everyday basis. I need to log on to  my deployment/stage/whatever, server and do some redundancy. E.g. download some logs, clean up some caches and/or redeploy something. Here is the occasion, when Fabric comes handy. You can eliminate all the redundancy and cover tons of operations you need to do every day, using console, shortcutting them to one of your simple commands, like: fab deploy_production -H interested? Let's move on then. Notie this command is not a masterpiece, but must give you the understanding of usual workflow.
1. Installation and purposes Let's go ahead, installing Fabric and automating some simple operations. You can read official docs about alternative methods. But installation is fairly simple. And is the matter of typing:

$pip install fabric
Nothing more special is required. You will need fabric at system wide scale. I install it locally with superuser privilegies. Note I'm assuming i…