Xml transform on wrong file

We have an environment specific transform a part of our deployment. It appears that the ‘External’ transform is being applied on top of the release transform, rather than onto the config itself. This means that we do not get these transforms in the final file. Surely this is a bug?

2013-09-17 11:10:27 DEBUG [XML Transformation] Start tranformation to 'D:\Octopus\Applications\Production1\EurofficeGroup.Web.Support\1.0.42.0\Web.Release.config'. 2013-09-17 11:10:27 DEBUG [XML Transformation] Source file: 'D:\Octopus\Applications\Production1\EurofficeGroup.Web.Support\1.0.42.0\Web.Release.config'. 2013-09-17 11:10:27 DEBUG [XML Transformation] Transform file: 'D:\Octopus\Applications\Production1\EurofficeGroup.Web.Support\1.0.42.0\Web.Release.External.config'.

Hi,

It is a bug but it’s a bit unavoidable. Octopus figures out which pairs of source/transform files to run based on naming conventions.

Could you rename the file to:

Web.External.config

Paul

I had this same issue in Octopus Deploy 2.0.13.1100.

I had a Web.Release.config and a Web.Dev.config file in my solution. When I deployed to my DEV environment the Web.Release.config transformation was applied first, followed by the Web.Dev.config, except the second transformation was applied to the already transformed file.

This resulted in an exception e.g. when applying this standard transformation <compilation xdt:Transform="RemoveAttributes(debug)" />

This was resolved by removing all config transformation files for which I did not have an environment for. Is this normal though?

Cheers,

Steve

Hi,

This is by design - we assume that Web.Release.config is what you want to run whenever you release anything to any environment. It sounds like you actually have an environment called “Release” though, which your web.release.config is intended for. Is that right?

Paul

Hi Paul,

Not quite. I have a web.release.config in my solution and a build configuration but only because Visual Studio put it there. I guess that I just assumed it wouldn’t matter, thinking that irrespective of how many configs I have in my solution octopus would first scan for environment matching transformations, apply those, and only defaulting to the release configuration if it couldn’t find a match.

Maybe an enhancement, for the lazy dev? 

Cheers,
Steve

Why is it assumed that Web.Release.config needs to be ran regardless of what environment you are deploying to? In my case I have:

  1. QA
  2. Release

When I’m deploying to QA, I do not want Ocotopus Deploy to apply the Web.Release.config transform.

Am I missing a crucial point here?

Hi David,

Octopus assumes environments have names like Dev, QA, Staging, Production, and so on. “Release” in this context means “Released to anyone, anywhere”.

If you rename the environment to Production, you can then have:

  • Web.QA.config
  • Web.Production.config
  • Web.Release.config (runs on both)

Hope that helps to explain the design decision.

Paul

That makes perfect sense in context, thanks for the clarification.