Giter VIP home page Giter VIP logo

fabistrano's Introduction

fabistrano

Fabistrano is a set of Fabric tasks that allows you to do Capistrano style deployments for python web apps.

What is a capistrano style deployment?

Capistrano deploys code under versioned directories and then symlinks the latest one as the current release.

A sample structure would look like this:

  app.com
  |
  | - releases
    | - 1366924759
    | - 1366927898
    | - 1367155641
  | - shared
  | - current

Why use this style of deployment?

Using fabistrano you get the following benefits:

  • Scripted and ordered deployments
  • Very low downtime when deploying new code
  • Easy roll backs

Usage

  1. Install fabistrano:

pip install fabistrano

  1. In your fabfile.py you need to import fabistrano and set the environment variables:
  from fabistrano import deploy

  
  env.hosts = ["HOST"] # Replace with your host name or IP
  env.base_dir = '/www' # Set to your app's directory
  env.app_name = 'app_name.com' # This will deploy the app to /www/app_name.com/
  env.git_clone = 'GIT_PATH' # Your git url

  env.restart_cmd = 'kill -HUP `supervisorctl pid gunicorn`' # Restart command
  # or
  # env.wsgi_path = "app_name/apache.wsgi" # Relative path to the wsgi file to be touched on restart
  1. Run setup to create the directory structure:

fab deploy.setup

  1. Deploy the app:

fab deploy

  1. Setup your web server to point to the current directory.

And you should be good to go!

Current status

This tool is under active development and you might see errors.

License

The template itself is available under the "Simplified" BSD license and can be freely modified under the terms of that license. You can see the full license text in the Github repository for additional detail.

Applications created using this template are not considered derivatives works. Applications created using this template can be freely licensed under whatever you as the author chooses. They may be either open or closed source.

fabistrano's People

Contributors

ben-xo avatar co3k avatar dlapiduz avatar meshy avatar wemcdonald avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.