Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion management of project configuration files

What is best practice for using subversion (SVN) for managing a project that requires a single configuration file that has multiple concurrent versions for different environments.

I.e.

  • Project ABC is used for three different environments, that use the same code, except for a slightly modified configuration file. AND
  • Project ABC is also developed by multiple developers, using a slightly modified configuration file for each developer.

I am aware that a configuration file template and svn:ignore could be used, but was wondering if anyone could describe best practice for this approach, and/or any other suitable alternatives.

Thanks in advance!

M.

like image 919
Morgan Avatar asked Sep 30 '09 02:09

Morgan


2 Answers

Keeping multiple files in source control can be tricky. We use a home brew configuration tool that reads a system environment variable and from that reads a matching config file and then modifies a shared configuration file. I can't say it's a great solution, but it works.

like image 34
csharptest.net Avatar answered Oct 02 '22 15:10

csharptest.net


I don't know if this is a "best practice" but this is how I handle this and it works very well. I have several apps and they each have a separate config file for their production, staging and dev environments. The configs are named web.config, stage.config and dev.config. All three are kept under version control. The app expects and uses web.config to retrive configuration settings. As part of our NANT build and deployment scripts called by cruise control, depending on the environment being deployed to, the appropriate config is renamed to web.config and deployed.

Hope this helps.

like image 135
Matt Wrock Avatar answered Oct 02 '22 13:10

Matt Wrock