I’m in the process of switching our team from using Powershell scripts for deployment to Octopus Deploy.
We had used the Web Package parameters previously for defining variables that changed from environment to environment.
Each web project has a parameters.xml file that defined names of parameters that could be transformed and it used a setParameters.xml file to define the environments’ values.
An example of a parameters.xml:
And the typical setParameters.xml (which could be replaced in Octopus Deploy with Variables):
This would be a perfect solution (I think) for defining settings that need to change but aren’t appSettings or connectionStrings.
It would be fantastic if this could also be used for Windows Service deployments as well! Is something like this already available and I’m just unaware of it?
An example of a parameters.xml:
<parameters>
<parameter name="ContactService Service Endpoint Address"
description="Specify the endpoint URL for the ContactService WCF
service in the destination environment"
defaultValue="http://localhost/ContactManagerService">
<parameterEntry kind="XmlFile" scope="Web.config"
match="/configuration/system.serviceModel/client
/endpoint[@name='BasicHttpBinding_IContactService']
/@address" />
</parameter>
</parameters>
And the typical setParameters.xml (which could be replaced in Octopus Deploy with Variables):
<parameters>
<setParameter
name="ContactService Service Endpoint Address"
value="http://production/ContactManagerService" />
</parameters>
Unfortunately you cannot use XML the way that you have shown below.
Octopus does have a specific way to deal with XML Configuration Files which you can read about in our documentation:
There is also the option to do the following variable substitution if that is more suitable to your needs:
If you have any further questions, do not hesitate to ask!
This is where our users can make suggestions, vote on them and comment.
Feel free to have a search and look for maybe an existing suggestion to vote on before adding your own to stop any double up.