On 27 Jun 2008, at 12:20, Kevin Ansfield wrote:
> Hi guys,
> I'm starting to have some issues with the way I'm managing a couple of
> sites based off of a single codebase. Each site has it's own theme,
> deploy.rb and minor changes to the app.
We avoid committing deployment configurations to the repository. You
could also consider using hostname based configs, rake generated
configs, and so on.
> At the moment I have each of these as a branch based off of master in
> git but the master also has it's own deploy.rb to push to a demo site,
> staging, etc. This is causing problems as every time I rebase the site
> branches from master I end up with a huge string of conflicts
> revolving around deploy.rb.
Branching is not entirely designed for this purpose, of course, it's
the way rails guides you to work that will have led you to using
branches for that. Can't you submodule out the app/views directory for
each 'subproject', having a common repository for the underlying app
logic?
> How do you guys handle a situation like this where you have multiple
> instances of an app based off virtually the same codebase?
In the past, badly, but really this is the old build script problem,
and you want to think about your workflow, design something that fits,
and commit to its conventions.
> I see a couple of options:
> 1) Remove deploy.rb from master and have another seperate branch for
> the demo site and staging.
> 2) Fork the main project for each site instance and forget about using
> branches for each site
> Does forking the project provide any benefits other than avoiding the
> deploy.rb and possible view conflicts? Are there any better ways to
> manage such a situation?
Forking? I presume you mean github? A fork is just a clone of a repo,
and you merge as if it was a branch (only, the branch may be remote),
so 'forking' won't strictly assist you in any way.
If the code base is split, then split the code base... I think the
rails view paths may also be configurable, so have a poke around in
the rails docs too. If not, they might be easy to patch for that.
HTH