Zaqintosh Zaqintosh - 1 year ago 64
Git Question

Good Git deployment using branches strategy with Heroku?

What is a good deployment strategy to use with Git + Heroku (Ruby on Rails)?

Currently the way I work with my origin Git repository: All features (or 'stories') are first checked out as branches, then get merged with master and pushed to origin.

Anything pushed to origin/master triggers a script that pulls the new rails code to the staging area (simple rails webserver).

When the time comes for me to push a new production version to Heroku, should I create a new branch (called something like production_version_121), and push that somehow to Heroku?

Ideally I'd like to pick and choose which features from previous development versions I should include into the production branch... test it, and push to Heroku.

For example, I may not want all the latest code to get pushed to production. I might want feature "a" that I had worked on and feature "c" both merged into production somehow, without including experimental feature "b" which needs more debugging.

N.B. I'm going to try avoiding capistrano at first and get something working manually for now.

Thoughts? Best Practices?

Answer Source

In the Gemcutter project we simply have a production branch. Any changes that we want to see on the production site get merged into that branch, and then deployed with:

git push heroku production:master

The staging branch serves a similar purpose for the staging site (also on Heroku)