+1 -1 +8
Vote on this proposal

Continuous deployment with Fabric

by akshar raaj (speaking)

Section
Infrastructure
Technical level
Intermediate

Objective

People attending this talk will leave with an understanding of continuous deployment and continuous deployment tools in general and Fabric in particular.

They will appreciate the usefulness of a continuous deployment tool like Fabric. Essentially they will realise the time they save by using a single step build process. By the time they leave, they would have learned how to write a Fabric script which can automate deployment.

Description

Your time is precious and is best spent writing code. It should not be wasted on a production server doing the repetitive task again and again. And by repetitive task I mean fetching the code changes to server, installing the libraries, restarting the web server, restarting the proxy server and so on.

Code changes continuously. And you need to deploy the code to production every day, possibly you want to deploy with every code push. And sshing to the server every time you want to deploy, and doing the repetitive tasks is a waste of time and energy.

So, deployment of code should be automated. Joel's test has a requirement that build should be a one step process.

Fabric is a command-line tool for streamlining the use of SSH for application deployment (taken from docs).

We will write a basic web application using Python. This application will serve few urls. We will use gunicorn as the web server.

Every time we want to deploy we need to do the following

  • cd to required directory.
  • Fetch the code from the repository and checkout to master. (We will use github)
  • Activate the virtual environment.
  • Install the requirements i.e the third party libraries on which the application depends.
  • Kill existing gunicorn process.
  • Start a new gunicorn process

We will ssh to a server and will deploy the code there. We will perform the steps mentioned above. You will notice the time it takes and pain involved in performing those steps manually. And then we will write a Fabric script which can automate these steps for us, which will be much faster than the previous approach where we manually had to do every step involved in build.

Speaker bio

I am a web developer at Agiliq. I primarily work with Python, Django and the related technology stack. I help people by writing open source code, blog, and by answering questions on Stack Overflow.

Comments

Login with Twitter or Google to leave a comment →