Deployment of code in test/staging/production servers is one of the important part of modern web applications development cycle.
Deploying code were painful because its repetitive same tasks we have to do every time we want to push code, during deployment if something goes wrong the application will go down too. But the scenario has changed, now we have many tools to make the deployment easier and fun. I have used Capistrano and Fabric for deployment. Found Fabric really painless and as its a Python battery, it was easier for me to adopt and get things done.
I am going to cover fundamental operations and finally a simple fabric script(like boilerplate) for writing your own fabric script.
env = its a Python dictionary like subclass where we define specific settings like password,user etc
local = runs command in local host(where fabric script is being run)
run = runs command in a remote host
You can use these code tasks in many different ways, to do that check the Fabric Office Documentation from here.
First gist is a sample fabric script,second one is a bash script to install fabric in your ubuntu machine.
After setting username,password and host information into the script you cab check your server’s access log by running fab test_server latest_access_log
I am using fabric for around two years and used for different small,medium and large projects.
There are many interesting open source projects going on top of Fabric. I found these two projects really promising.
Search through github,you will find many advance level Fabric use.