[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: How to manage client configurations for Rails project

From: John Almberg <jalmberg_at_identry.com>
Date: Mon, 18 Feb 2008 18:54:03 -0500

> I have been using SVN to manage development of a Rails application.
> The main line of development is in a repository called /svn/ts/
> trunk/. I use Capistrano to automate deployment to my webserver.
>
> I've now licensed this application to a number of clients. All
> these clients will use the same code -- except for certain bits,
> such as the files in the /config, /public/stylesheets, and /app/
> views/layouts directories. These need to be different for each
> client, so each client has his own database, etc., and his own
> graphic design.
>
> Here is what I'd like to do:
> - use SVN to manage the main development in /svn/ts/trunk (this
> works)
> - use SVN to manage the client-specific code. Right now, the
> client-specific code is not in SVN, simply because I can't figure
> out how to do it correctly.
> - issue quarterly releases to all clients, which would include the
> combination of trunk code, plus client-specific code for each client
>
> For working on the client-specific code, I need to be able to check
> out a combination of the trunk code + the client-specific code into
> a project directory, so I can run Mongrel and script/console, and
> all the other Rails goodies. In other words, I need a project
> directory with the complete set of code for that client.
>
> For doing releases, I need to be able to deploy the same set of
> code to the webserver.
>
> In the project directory for the main trunk, I want a generic set
> of code, so I can do development, testing, etc.
>
> Pretty straight forward stuff, but I'll be darned if I can figure
> out how to use SVN to achieve this. I'm currently using a kludgy
> manual procedure to prevent deployments from the trunk from
> blowing away the client-specific code. That worked with the first
> couple of clients, but I really need to figure out the correct way
> to handle this, before the next client deployment.
>
> Any hints, much appreciated!
>
> Brgds: John

Well, after trying various approaches, I discovered the svn:externals
property. This seemed promising, so I tried the following:

1. create a new SVN project with just the client-specific directories
-- i.e., the Rails directories that contain files that will be
modified for a specific client. These include public/ and config/ at
the moment.

2. use svn:externals to link the rest of the directories from the
main trunk to the client project: app/, components/, etc.

After an svn update, I had all the files I needed in the client
directory.

I haven't had time to modify the Capistrano deploy file so I have no
idea how this svn:external thing will work on deployment. I'm hoping
that SVN will 'magically' download both the client-specific and
external files from the main project.

However, my brain is too fried to tackle that today. Tomorrow is
another day!

-- John
Received on 2008-02-19 00:54:31 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.