Web.Config Conversion with Octopus Deployment

I want to apply web.config conversions with Octopus Deploy, but only in a production environment.

I do not want to create separate configs for all other environments.

I am currently using this following custom expression, but it does not apply the conversion

enter image description here

+6
source share
2 answers

Are you specifically trying to change key / value pairs in the web.config file of your project? XML conversions are a completely different feature. Read the documentation here: http://docs.octopusdeploy.com/display/OD/Configuration+files . This documentation also applies to the MS conversion documentation: http://msdn.microsoft.com/en-us/library/dd465326.aspx

Having said that, it seems you want to say that you want to change the value of the configuration variables in Octopus. An octopus can definitely do this; especially when targeting a specific environment. Click the Variables tab in your project. Inside the variable tab, the Name column refers to the value that you want to change in the web.config or app.config file. This is the EXACT name that appears in the file, so you do not need to change anything directly in the file to match it.

The value, of course, should be displayed. Then the column "Variable area" allows you to specify the environment, server, roles, and even the step inside the process (mine is not displayed, since this is an empty project).

enter image description here

Edit: Read this documentation from Octopus Deploy in the configuration files (and then the web transforms). It looks like your custom conversion expression is wrong if you are trying to remove the debug mode flag. Judging by the expression that you enter, it will display as "TrueProduction.Production", which really does not describe any type of conversion. You should probably try this:

<?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.web> <compilation xdt:Transform="RemoveAttributes(debug)" /> </system.web> </configuration> 

Make sure you have a web configuration file for your product as: Web.Production.config if you want to apply it only to Production. Make sure Web..Config matches this environment name in Octopus. Again, this is in the documentation on the Octopus Deploy website.

+6
source

What you need to do is create a Web.Production.config conversion file, where "Production" is the name of your production environment. Once you enable XML transformation as part of the Octopus Deploy task, Octopus will only apply the production transformation when it is deployed as a production environment. This may also be true if you create a Web.Release.config conversion file instead of a specific environment file, but I'm not sure.

0
source

All Articles