Using capistrano to deploy from different git branches

Posted by Toms Mikoss on Stack Overflow See other posts from Stack Overflow or by Toms Mikoss
Published on 2009-10-06T08:06:01Z Indexed on 2012/10/15 21:37 UTC
Read the original article Hit count: 206

Filed under:
|

I am using capistrano to deploy a RoR application. The codebase is in a git repository, and branching is widely used in development. Capistrano uses deploy.rb file for it's settings, one of them being the branch to deploy from.

My problem is this: let's say I create a new branch A from master. The deploy file will reference master branch. I edit that, so A can be deployed to test environment. I finish working on the feature, and merge branch A into master. Since the deploy.rb file from A is fresher, it gets merged in and now the deploy.rb in master branch references A. Time to edit again.

That's a lot of seemingly unnecessary manual editing - the parameter should always match current branch name. On top of that, it is easy to forget to edit the settings each and every time.

What would be the best way to automate this process?

Edit:

Turns out someone already had done exactly what I needed.

© Stack Overflow or respective owner

Related posts about git

Related posts about capistrano