capflow

Capflow provides Gitflow integration with Capistrano, without unessecary restrictions to the deploy process. Our goal with capflow was to improve on capistrano-gitflow by allowing you to tag a staging release (or not tag a staging release), deploy from the HEAD of whatever branch you are on (feature, develop, hotfix, etc), and deploy to production from bonafide gitflow release tags.

Installation

You can use the most recent capflow gem by adding it to your Gemfile:

gem 'capflow'

Or install it the old-fashioned way:

gem install capflow

Capistrano Setup

You’ll need to require the capflow recipe in deploy.rb:

require 'capistrano/ext/multistage'
require 'capistrano/capflow'

That’s all you need. Capflow will set the :branch variable and allow you deploy from any tag, branch or release whenever you wish.

Optional Setup

If you’re using the gitflow binary github.com/nvie/gitflow , capflow provides a nice helper to initialize your project using our favorite defaults:

rake gitflow:prepare

This will attempt to create a develop branch if one doesn’t exist locally or remotely, track it and add the following defaults:

gitflow.branch.master = master
gitflow.branch.develop = develop
gtiflow.prefix.versiontag = v

Deploy to staging

To deploy what you’re currently working on to staging:

cap staging deploy

Capflow will ask if you’d like to tag the release. The tag will include the date, who is deploying and a message. You will then be able to specify that tag as what you’d like to deploy.

Deploy to production

After you’ve finished a release branch, capflow will show you all the available releases to deploy from:

cap production deploy

Contributing to capflow

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Spencer Markowski (The Able Few, LLC). See LICENSE.txt for further details.