On Tue, 2009-05-26 at 17:37 -0700, .Net2Php wrote:
> We have a repository, from which we can do an "svn up" from our
> development server's public_html folder via SSH. This works fine as
> all the latest revisions are deployed (is "deployed" the correct
> term?).
> 
> We have a production server, also. We can log in to this server via
> SSH, go to it's public_html, and do an "svn up." An exact copy of what
> is deployed to our development server is deployed to our production
> server.
> 
> Here's the catch: some of the files need to be different from
> development to production server (primarily configuration files). How
> should we set this up such that when we deploy to the development
> server, we get the development configuration files -- and when we
> deploy to the production server, we get the production configuration
> files?

In the main configuration file you can do a check for which server it is
running on and then include the required configuration file for the
development or live server. 

if ($_SERVER['SERVER_NAME'] == "www.foo.com") {
  include "config1.php";
}
else  {
  include "config2.php";
}

That way you can have both the server and development configs checked
into SVN at the same time and the correct one will be loaded
automatically.

Checking out a repository on your live server is generally not a good
idea.  Make sure you protect the .svn directories using .htaccess or
similar. 





--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to