We also use bamboo for CI and deployment, and what we do:
- A package project containing the default Parameters.xml file as the msdeploy parameter declaration file.
- Maintaining SetParameters.xml files for our diverse environement.
- Packaging projects at night assembly.
- Release night packs as bamboo artifacts.
- Using msdeploy to apply parameterization for these packages when deploying for a particular nightly build.
Basically, the deployment with respect to msdeploy is as follows:
msdeploy -verb:sync -source:package="NightlyPackage.zip" -dest:iisApp="YourIISHost/YourIISSite" -declareParamFile="YourEnvironementSetParameters.xml"
Your Parameters.xml package for each project will look like this:
<parameters> <parameter name="ConnectionString1-Web.config Connection String" description="" defaultValue="localhost"> <parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/connectionStrings/add[@name='ConnectionString1']/@connectionString" /> </parameter> </parameters>
Where ConnectionString1 is the name of connectionString.
And your YourEnvironementSetParameters.xml will look like this:
<parameters> <setParameter name="ConnectionString1-Web.config Connection String" value="Your parametrized connection string value " /> </parameters>
There are conventions when using parameterization in some fields with webdeploy. Connection strings are interested, therefore, it is recommended that you observe the following parameter names when you need to access web.config connection strings:
%NameOfYourConnectionStringAsInWebConfig%-Web.config Connection String
source share