We are using the ‘Substitute variables in files’ feature while deploying an application, we use a Octopus.web.config which has all the variables in it. While deploying web.config is deleted and Octopus config file is renamed as web.config. Problem is some settings/variables only exist in test environment, they dont exist in UAT/PROD environment. Is there a way to get rid of the particular setting when deploying it to a certain environment?
Thanks for getting in touch. A typical approach to this is to use Config Transforms. What I would do is:
- Enable the
Configuration Transforms feature in your Project Step
- Add the appropriate configuration transform files to your source code, one for each environment where you want to delete the settings.
- Create a new Release with this new version including the config transforms and deploy it.
For more information on the config file transform syntax: https://msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx
You will specifically need the
Hope that helps!