This posting here (http://stackoverflow.com/questions/156044/how-do-you-manage-database-revisions-on-a-medium-sized-project-with-branches) got me wondering how best to work on a web project using branching and deploying to dev, staging, and production (along with local copies).
We don't have "releases" per se: if a feature is big enough to be noticeable, we push it live (after requisite testing/etc.), otherwise we batch a few up and, when it feels "comfortable", push those live. The goal is to never have a deploy more than once or twice a month or so because a constantly shifting site tends to make the users a bit uneasy.
Here's how we do it, and it feels sort of brittle (currently using svn but considering a switch to git):
- Two "branches" - DEV and STAGE with a given release of STAGE marked as TRUNK
- Developer checks out a copy of TRUNK for every change and creates a branch for it
- Developer works locally, checking in code frequently (just like voting: early and often)
- When Developer is comfortable it isn't totally broken, merge the branch with DEV and deploy to the development site.
- Repeat 3-4 as necessary until the change is "finished"
- Merge change branch with STAGING, deploy to stage site. Do expected final testing.
- After some period of time, mark a given revision of STAGE as the TRUNK, and push trunk live
- Merge TRUNK changes back down to DEV to keep it in sync
Now, some of these steps have significant complexity hand-waved away and in practice are very difficult to do (TRUNK -> DEV always breaks) so I have to imagine there's a better way.
Thoughts?