Fabric Bolt: Deploying Made Awesome
Sept. 7, 2014


At Worthwhile, we use fabric for deploying websites to our servers. Fabric is a python library which makes running commands on multiple remote servers easy.

With Django projects, there are several commands that need to be executed every time you deploy an update. Typically, you need to do a git pull, then collect static, then migrate any migrations, and finally, restart the server. If you deploy to multiple servers, ssh'ing and typing 4 commands on each one is not a good option. That's where fabric comes in handy. You just create some fabric tasks, specify which servers to run the tasks, just run one command from your local machine, and your done.

Every year, there is a 48 hour Django competition called Django Dash. Last year, three of us competed and won first place. (Well, we tied for first place.) We wrote Fabric Bolt.

Fabric Bolt

Fabric Bolt is simply a web interface to Fabric. Which allows non-developers to be able to deploy, like say, once the client has approved a change, and it has been tested on a dev server.

Basically Fabric Bolt works like this. First you will setup everything:

  1. Set up some hosts your projects run on.
  2. Create a project.
  3. Define configuration global to the project.
  4. Define some stages for your project. A stage is a way group hosts for a project to deploy to. (think develop, staging, production, etc)
  5. For each stage, select which host servers the project should be deployed to, and add any stage-specific configuration.

Once everything is setup, just choose a project, then a stage, select a fabric task, and run.

What makes this great is that anyone can use it, and it keeps a record of every deployment ever done. There are some other features like only allowing deployments during certain times. (Don't deploy to production on Fridays!)

Now accepting pull requests

We would like to continue adding features and improving Fabric Bolt, so if you have any new ideas for it, let me know. Or if you want to contribute to it, by all means, go ahead. It is available under the MIT license on GitHub. You can read the docs on Read the Docs. If you find a bug, report it on the issue tracker.

comments powered by Disqus