Additional transforms run before the Release transform?

Hello,

My application contains the following configuration and transformation files:
Web.config
Web.Release.config
Web.MachineX.config

I do not have an environment transformation file. The documentation states:
“When deploying to an environment named “Production”, Octopus will execute Web.Release.config, followed by Web.Production.config.”

Makes sense.

I have enabled both the default XML transforms feature and the Additional transforms feature.
The Additional transforms feature is set to:
Web.#{Octopus.Machine.Name}.config => Web.config

To my surprise, when doing a deployment the Web.config is first transformed using the additional (machine) transform and afterwards the default XML transforms feature runs which transforms the Web.config again using Web.Release.config.

This makes no sense to me. It is the opposite of an environment transformation and when using additional transforms I would expect them to run last as the naming suggests.

Is this a bug or am I doing something wrong?

Hi Dennis,

Thanks for getting in touch! You can define the specific order of transforms by listing them all in order in the additional transforms text box.
So if you want to run the machine one last then you can define it as such:

Web.Release.config => Web.Config
Web.#{Octopus.Machine.Name} => Web.config

Then it will run as you have defined. When variables are involved they can run first, but if you define all it will run in the order you state.

Hope that helps!
Vanessa

Thank you, that certainly helps!

Hi!

I have also encountered same problem, but you suggested doesn’t work for me because i have transformations which are adding some content to web.config but the last transformation which runs does not remove that content and it stays in web.config.

I would expect transformations work automatically only in the case you haven’t defined explicit transformation rule for certain file.

Thank You!

Hi Andris,

Thanks for reaching out. I’m not sure I’m following your scenario. You are saying that the last transformation runs, which does not remove that content. Does this last transformation contain code that should be removing stuff from the web.config? Or are you saying that the problem is with the order in which transformations are running?

It would be useful if you could share us some screenshots of your Nuget Package Deploy step configuration so we can see how its set up, and along with that send us a deployment log.

http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

If you don’t want to share that information on this public ticket, feel free to email us as support(at)Octopus(dot)com

Regards,
Dalmiro