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

Re: Subversion for websites

From: Phyrefly <phyrefly.phyre_at_gmail.com>
Date: 2007-01-30 12:25:37 CET

> > We have a production db server, staging db server, and development
> > db servers for our developers. We plan to have developers checkout
> > from the trunk and set the staging and production environments to
> > serve from checked out tags.
> >
> > Within each of the three development environments, we modify the db
> > connection script to point to the proper db server.
> >
> > We are looking for a best practices solution for how to manage a
> > file in svn that our current setup requires to be different upon
> > the usage of the checked out code.
> >
> > Do we pull the one db connection script out of svn and manage it
> > manually? Or is there some clever way to drive svn to solve our
> > problem? Or should we make our connection script smart enough to
> > know which db server it should connect to (we aren't exactly sure
> > how to do this, but will consider it)?
> >

The easiest method I have discovered is to have an include file that
sits above the application root, so that it's never overwritten by an
update (indeed, it's not in svn in our environment). All this file
does is sets a variable (called Zone, in our case) to DEV, STG, or WWW
(again, in our specific case). Then you can either have an IF-THEN
structure, or use that string in your connection string to
differentiate (which is what we do) - so our live DB server is called
WWW_DB1 and the site sits at www.clientsdomain.com, while our dev
environment is on dev.clientsdomain.com, and the DB is on DEV_DB1.

This way the only file that is different between zones is the single
include file, which is not part of any project, but included by all
projects. It's not a hi-tec solution, but it works.

Hope this helps.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 30 12:26:04 2007

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