How to save various configurations, i.e. CD and CMS in Tfs?

I am trying to save different configuration files for a separate CD & CMS environment, are there any tools or options that I can use?

im using vs2013 with tfs.

thanks

+5
source share
2 answers

You can create a directory structure in which you store CM and CD files. The following is an example directory structure

--- App_Config

----- Enable

-------- zConfig

----------- CM Config

----------- CD configuration

Then you can create an assembly script that takes into account the assembly configuration (debugging, release). From this, when you build your decision, he will know what configuration to take.

I would suggest defining a new build configuration to minimize the risk of confusion. For example, create 1 for CM and 1 for CD

This is an example of what my build script looks like in my solution

if %Configuration% EQU DEBUG ( if exist %SolutionDir%..\..\Website\App_Config\Include\ABBs\UAT RMDIR /S /Q %SolutionDir%..\..\Website\App_Config\Include\ABBs\UAT if exist %SolutionDir%..\..\Website\App_Config\Include\ABBs\PRODCluster1 RMDIR /S /Q %SolutionDir%..\..\Website\App_Config\Include\ABBs\PRODCluster1 if exist %SolutionDir%..\..\Website\App_Config\Include\ABBs\PRODCluster2 RMDIR /S /Q %SolutionDir%..\..\Website\App_Config\Include\ABBs\PRODCluster2 if exist %SolutionDir%..\..\Website\App_Config\Include\ABBs\PRODCluster3 RMDIR /S /Q %SolutionDir%..\..\Website\App_Config\Include\ABBs\PRODCluster3 ) 

It will copy the configuration file from my solution to the path \ Website \ App_Config \ Include \ ABBs \ PRODCluster1 if my Debug assembly configuration

+1
source

For regular .NET configurations, you have the option of adding conversion files based on assembly configurations. You can also use Slowcheetah , which has a similar idea for files that are not standard .net configurations. The idea is to have one assembly configuration with appropriate conversion configurations. For example, in Visual Studio, you are setting up an assembly definition for CM and one for CD. Using conversion files, you can have specific environment configurations based on the appropriate environment (configurations for CM or CD). For deployment, you can configure any tool that you use, what assembly configuration it should use. For example, for deployment in a CD environment, you must create using the CD configuration, etc.

+4
source

Source: https://habr.com/ru/post/1258162/


All Articles