You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John Almberg <ja...@identry.com> on 2008/02/18 21:37:56 UTC

How to manage client configurations for Rails project

Howdy,

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



Re: How to manage client configurations for Rails project

Posted by John Almberg <ja...@identry.com>.
> 
> 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!
>

In case anyone else ever runs into this problem (no one currently on  
the list apparently cares!), I can confirm that, yes, indeed, using  
svn:externals solves this problem. It worked with a Capistrano  
deployment, with no problem.

Now, I just need to remember NOT to edit those external files  
(already done it once, already.) I need to figure out how to check  
them out read-only.

-- John


Re: How to manage client configurations for Rails project

Posted by John Almberg <ja...@identry.com>.
> 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