You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Andrew Brosnan <an...@broscom.com> on 2005/11/09 21:26:27 UTC
live and dev servers - best practices questions
Hello,
I'm joining a project that is set up as follows:
* a development server (web and database)
* two load balanced 'live' web servers
* two database servers - (master/slave)
* an offsite 'failover' server - (web and database)
Currently things are a mess because data that should be specific to each
running version is included in the lone branch in the repository; so for
example, an update of the code on the dev server will result in the dev
server trying to connect to the live db rather than the dev db.
Typically, do you just store this type of data outside of the
repository? Or would you have a development branch and a live branch?
The code running both live (and dev) servers are working copies. I'm
told that this was done for the ease of just being able to run 'update'
after changes, thus updating the live (or dev) server(s). What do people
think of this? How do others ensure that your code is up to date in
cases where the code needs to run in multiple places?
I'd appreciate any advice or references to further reading to get me off
on the right foot. The subversion book is great, but I find myself still
wondering about many 'best practices' type things.
Regards,
Andrew
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: live and dev servers - best practices questions
Posted by William Nagel <bi...@stagelogic.com>.
On Nov 9, 2005, at 4:26 PM, Andrew Brosnan wrote:
> Hello,
>
> I'm joining a project that is set up as follows:
> * a development server (web and database)
> * two load balanced 'live' web servers
> * two database servers - (master/slave)
> * an offsite 'failover' server - (web and database)
>
> Currently things are a mess because data that should be specific to
> each
> running version is included in the lone branch in the repository;
> so for
> example, an update of the code on the dev server will result in the
> dev
> server trying to connect to the live db rather than the dev db.
> Typically, do you just store this type of data outside of the
> repository? Or would you have a development branch and a live branch?
>
You might consider having four directories:
/dev_branch
/live_branch
/dev_config
/live_config
In dev_config and live_config, put files that can be read by the rest
of the site to get all necessary site-specific config information.
Then put the rest of your site in dev_branch/live_branch. On the
dev_branch and live_branch directories, set svn:externals properties
to point them to dev_config and live_config respectively. That way
you can easily merge the contents of dev_branch over to live_branch
without worrying that someone will accidentally merge development
site configuration information over to the live site.
>
> The code running both live (and dev) servers are working copies. I'm
> told that this was done for the ease of just being able to run
> 'update'
> after changes, thus updating the live (or dev) server(s). What do
> people
> think of this? How do others ensure that your code is up to date in
> cases where the code needs to run in multiple places?
Yes, as long as you don't mind having the extra overhead of .svn
directories on your servers using working copies seems to be the best
approach to take.
>
> I'd appreciate any advice or references to further reading to get
> me off
> on the right foot. The subversion book is great, but I find myself
> still
> wondering about many 'best practices' type things.
Well I wrote a book that covers a lot of SVN best-practices. It's
licensed under an open publishing license (much like the O'Reilly SVN
book), so you can get it in PDF form from Prentice-Hall's website
(link below), or you can buy a hard copy of it if you'd like.
http://www.phptr.com/title/0131855182
-Bill
>
> Regards,
> Andrew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: live and dev servers - best practices questions
Posted by "Mark T. Dame" <md...@mfm.com>.
Andrew Brosnan wrote:
>
> I'm joining a project that is set up as follows:
> * a development server (web and database)
> * two load balanced 'live' web servers
> * two database servers - (master/slave)
> * an offsite 'failover' server - (web and database)
>
> Currently things are a mess because data that should be specific to each
> running version is included in the lone branch in the repository; so for
> example, an update of the code on the dev server will result in the dev
> server trying to connect to the live db rather than the dev db.
Sometimes simpler is better: we use the server name 'masterdb' in our
code. Then in the /etc/hosts file on each machine, we set masterdb to
the correct database server. On production this goes to our main
database server. On our development server(s) it points to localhost
(since the development database server runs on the same box as the
development web servers).
> The code running both live (and dev) servers are working copies. I'm
> told that this was done for the ease of just being able to run 'update'
> after changes, thus updating the live (or dev) server(s). What do people
> think of this? How do others ensure that your code is up to date in
> cases where the code needs to run in multiple places?
We do exactly this on our production servers.
-m
--
## Mark T. Dame <ma...@mfm.com>
## VP, Product Development
## MFM Software, Inc. (http://www.mfm.com/)
"A brute force solution that works is better than an elegant
solution that doesn't work."
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: live and dev servers - best practices questions
Posted by William Nagel <bi...@stagelogic.com>.
On Nov 9, 2005, at 4:26 PM, Andrew Brosnan wrote:
> Hello,
>
> I'm joining a project that is set up as follows:
> * a development server (web and database)
> * two load balanced 'live' web servers
> * two database servers - (master/slave)
> * an offsite 'failover' server - (web and database)
>
> Currently things are a mess because data that should be specific to
> each
> running version is included in the lone branch in the repository;
> so for
> example, an update of the code on the dev server will result in the
> dev
> server trying to connect to the live db rather than the dev db.
> Typically, do you just store this type of data outside of the
> repository? Or would you have a development branch and a live branch?
>
You might consider having four directories:
/dev_branch
/live_branch
/dev_config
/live_config
In dev_config and live_config, put files that can be read by the rest
of the site to get all necessary site-specific config information.
Then put the rest of your site in dev_branch/live_branch. On the
dev_branch and live_branch directories, set svn:externals properties
to point them to dev_config and live_config respectively. That way
you can easily merge the contents of dev_branch over to live_branch
without worrying that someone will accidentally merge development
site configuration information over to the live site.
>
> The code running both live (and dev) servers are working copies. I'm
> told that this was done for the ease of just being able to run
> 'update'
> after changes, thus updating the live (or dev) server(s). What do
> people
> think of this? How do others ensure that your code is up to date in
> cases where the code needs to run in multiple places?
Yes, as long as you don't mind having the extra overhead of .svn
directories on your servers using working copies seems to be the best
approach to take.
>
> I'd appreciate any advice or references to further reading to get
> me off
> on the right foot. The subversion book is great, but I find myself
> still
> wondering about many 'best practices' type things.
Well I wrote a book that covers a lot of SVN best-practices. It's
licensed under an open publishing license (much like the O'Reilly SVN
book), so you can get it in PDF form from Prentice-Hall's website
(link below), or you can buy a hard copy of it if you'd like.
http://www.phptr.com/title/0131855182
-Bill
>
> Regards,
> Andrew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: live and dev servers - best practices questions
Posted by Marcello <m....@spinsoft.it>.
Dan Levine ha scritto:
> I would love to hear other replies on this as well.
>
> The way we handle a similar situation is through an Ant Replace task in the
> build script. Assuming you run:
>
> svn update
> ant compile
>
> The second step can be used to pull values from a (local server specific)
> data file and replace placeholders (%DBNAME%) with the actual values. That
> specific file does have to live outside of SVN though. (Or you could check
> them all in with different names, and use an environment variable on each
> server to specify to ant which to use, but that is a bit muddy imho.)
>
> Dan
>
> -----Original Message-----
> From: Andrew Brosnan [mailto:andrew@broscom.com]
> Sent: Wednesday, November 09, 2005 1:26 PM
> To: users@subversion.tigris.org
> Subject: live and dev servers - best practices questions
>
> Hello,
>
> I'm joining a project that is set up as follows:
> * a development server (web and database)
> * two load balanced 'live' web servers
> * two database servers - (master/slave)
> * an offsite 'failover' server - (web and database)
>
> Currently things are a mess because data that should be specific to each
> running version is included in the lone branch in the repository; so for
> example, an update of the code on the dev server will result in the dev
> server trying to connect to the live db rather than the dev db.
> Typically, do you just store this type of data outside of the
> repository? Or would you have a development branch and a live branch?
>
> The code running both live (and dev) servers are working copies. I'm
> told that this was done for the ease of just being able to run 'update'
> after changes, thus updating the live (or dev) server(s). What do people
> think of this? How do others ensure that your code is up to date in
> cases where the code needs to run in multiple places?
>
> I'd appreciate any advice or references to further reading to get me off
> on the right foot. The subversion book is great, but I find myself still
> wondering about many 'best practices' type things.
>
> Regards,
> Andrew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
I keep the dev. version of the code in /trunk and the production version
in /branch/prod.
The production branch was made by copying the trunk when I felt it was
ready for production, and then by changing a few config parameters so
that the application pointed to the prod servers.
Now whenever I make a change to /trunk that I feel I want in production
too I just merge the affected files.
HTH
--
Marcello Romani
Developer
Spin s.r.l.
Reggio Emilia
http://www.spinsoft.it
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: live and dev servers - best practices questions
Posted by Dan Falconer <li...@avsupport.com>.
Our team has the same sort of scenario, though ours is modified by one small
but important factor: our live webserver uses an actual domain name
(www.partslogistics.com), while our development servers run on "fake"
domains, accessibly by internal DNS only (dev.pl.local, developername.pl.int,
etc.).
Knowing that, we've got a config file that determines whether it's a
development server or a live server based upon the FQDN: if it doesn't have
"partslogistics.com" in it, the code assumes it's a development server, and
sets the proper variable to point to the appropriate database server. This
isn't exactly the "best" or "simplest" approach, but it does work.
I hope this helps.
- Dan Falconer
"Head Geek",
AvSupport, Inc. (http://www.partslogistics.com)
On Wednesday 09 November 2005 3:44 pm, Dan Levine wrote:
> I would love to hear other replies on this as well.
>
> The way we handle a similar situation is through an Ant Replace task in the
> build script. Assuming you run:
>
> svn update
> ant compile
>
> The second step can be used to pull values from a (local server specific)
> data file and replace placeholders (%DBNAME%) with the actual values. That
> specific file does have to live outside of SVN though. (Or you could check
> them all in with different names, and use an environment variable on each
> server to specify to ant which to use, but that is a bit muddy imho.)
>
> Dan
>
> -----Original Message-----
> From: Andrew Brosnan [mailto:andrew@broscom.com]
> Sent: Wednesday, November 09, 2005 1:26 PM
> To: users@subversion.tigris.org
> Subject: live and dev servers - best practices questions
>
> Hello,
>
> I'm joining a project that is set up as follows:
> * a development server (web and database)
> * two load balanced 'live' web servers
> * two database servers - (master/slave)
> * an offsite 'failover' server - (web and database)
>
> Currently things are a mess because data that should be specific to each
> running version is included in the lone branch in the repository; so for
> example, an update of the code on the dev server will result in the dev
> server trying to connect to the live db rather than the dev db.
> Typically, do you just store this type of data outside of the
> repository? Or would you have a development branch and a live branch?
>
> The code running both live (and dev) servers are working copies. I'm
> told that this was done for the ease of just being able to run 'update'
> after changes, thus updating the live (or dev) server(s). What do people
> think of this? How do others ensure that your code is up to date in
> cases where the code needs to run in multiple places?
>
> I'd appreciate any advice or references to further reading to get me off
> on the right foot. The subversion book is great, but I find myself still
> wondering about many 'best practices' type things.
>
> Regards,
> Andrew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: live and dev servers - best practices questions
Posted by Dan Levine <dl...@currentmedia.com>.
I would love to hear other replies on this as well.
The way we handle a similar situation is through an Ant Replace task in the
build script. Assuming you run:
svn update
ant compile
The second step can be used to pull values from a (local server specific)
data file and replace placeholders (%DBNAME%) with the actual values. That
specific file does have to live outside of SVN though. (Or you could check
them all in with different names, and use an environment variable on each
server to specify to ant which to use, but that is a bit muddy imho.)
Dan
-----Original Message-----
From: Andrew Brosnan [mailto:andrew@broscom.com]
Sent: Wednesday, November 09, 2005 1:26 PM
To: users@subversion.tigris.org
Subject: live and dev servers - best practices questions
Hello,
I'm joining a project that is set up as follows:
* a development server (web and database)
* two load balanced 'live' web servers
* two database servers - (master/slave)
* an offsite 'failover' server - (web and database)
Currently things are a mess because data that should be specific to each
running version is included in the lone branch in the repository; so for
example, an update of the code on the dev server will result in the dev
server trying to connect to the live db rather than the dev db.
Typically, do you just store this type of data outside of the
repository? Or would you have a development branch and a live branch?
The code running both live (and dev) servers are working copies. I'm
told that this was done for the ease of just being able to run 'update'
after changes, thus updating the live (or dev) server(s). What do people
think of this? How do others ensure that your code is up to date in
cases where the code needs to run in multiple places?
I'd appreciate any advice or references to further reading to get me off
on the right foot. The subversion book is great, but I find myself still
wondering about many 'best practices' type things.
Regards,
Andrew
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org