Project

deployflow

0.0
No commit activity in last 3 years
No release in over 3 years
Quiet multistage versioning/deployment strategy using git-flow and capistrano-multistage
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.6.0
>= 0

Runtime

 Project Readme

deployflow

deployflow lets you use git-flow (or any git tag-based versioning strategy, really) to release into a 'staging' branch and then promote specific tags into your 'master' branch for deploying to production. It's for those of us who are persnickety about keeping 'master' as a canonical repository of what's actually running in production and doing all our mucking about elsewhere.

Installation

  1. git-flow

    I'd recommend you use my custom fork of git-flow with deployflow. It adds version number auto-incrementation and suppresses the need to add a message to each tag you create. You can install it by:

    brew uninstall git-flow (if you've previously installed git-flow via Homebrew)
    git clone --recursive git://github.com/nmeans/gitflow.git
    cd gitflow
    make install (or sudo make install if you don't own /usr/local/bin)

    If you'd prefer the original, visit http://github.com/nvie/gitflow for install information.

  2. deployflow

    gem install deployflow

    This will also install capistrano and capistrano-ext if you don't already have them.

Repository Setup

  1. Add a couple of required branches to your repo

    If you don't already have them, you'll need to add 'develop' and 'staging' branches. You should have a 'master' branch by default. eg:

    git branch develop
    git branch staging

  2. Run git flow init on your repo

    You'll want to use 'staging' as your branch for production releases (contradictory, I know, but trust me) and 'develop' for next release development. eg:

    [~/Projects/deployflow-test]$ git flow init
    
    Which branch should be used for bringing forth production releases?
      - develop
      - master
      - staging
    Branch name for production releases: [master] staging
    
    Which branch should be used for integration of the "next release"?
      - develop
      - master
    Branch name for "next release" development: [develop] develop
    
  3. Add the following to the top of your config/deploy.rb

    require 'capistrano/ext/multistage'
    require 'capistrano/deployflow'

Usage

Just use git-flow like normal. (What is 'normal'? Here's a good primer.) Create a release you want to deploy with git flow release or git flow hotfix.

When you're ready to deploy your release to staging, no need to push first, just run cap staging deploy and deployflow will automatically push to origin and deploy your most recent tag to staging.

After you've tested in staging, you're ready to promote your tag to master and roll it out to production. All you have to do is cap production deploy, and deployflow will ask which tag you'd like to promote (suggesting your most recent automatically), merge that tag over to your master branch, push to origin, and deploy that tag to production.

Credits

Heavily inspired by and some code from Josh Nichols' capistrano-gitflow, which was in turn inspired by Alan Pinstein's git-deployment.

Copyright

Copyright (c) 2011 Nickolas Means / ActiveProspect, Inc. See LICENSE.txt for further details.