I am new to Octopus and was trying to use Configuration Transforms in conjunction with substitute variables.
I have 2 files in the package exe.release.config, exe.config, which gets extracted in Octopus.Action[Extract].Output.Package.InstallationDirectoryPath path.Substitute variable worked without any issue and updated the exe.release.config with the right values from Octopus variables. When I try to use Configuration Transforms it does not update the files inside the package or in any custom location. One thing I noticed is it is working inside the work folder which soon gets deleted but fails to work on the InstallationDirectoryPath or any path given by me. All the variables are getting resolved properly and this is what I am trying to do under Additional Transforms(variables replaced with values):
Is Configuration Transformation restricted to only the package contents and that too in work folder? If there is no other way which variables I can use to copy the contents of Work folder after configuration transformation has been applied inside it?
Thanks for getting in touch, and welcome to Octopus! I hope you’ve found it useful so far.
I think the issue here is due specifically to the absolute path set to the exe.config file (as defined in your
Additional Transforms section). Absolute paths to config files are not supported (which also means they have to be in the package being deployed), whereas they are supported for transform files (i.e. exe.release.config).
Since both the config and transform files are within your package, you could instead specify the relative path to these files within the package. For example, if they both exist in the
Config\ subdirectory, you could configure the
Additional Transforms section to
Config\exe.release.config => Config\exe.config
We have some more details in the following doc page.
I hope this helps! Let me know how you go, or if you have any further questions or concerns moving forward.
Thanks for the details Kenneth, Yes Octopus deployment tool is proving to be very useful and documentation provided makes it very easy to learn and practice.
One more query regarding the same issue, is it possible to make configuration transform work on Octopus.Action[Extract].Output.Package.InstallationDirectoryPath, if not what will be variable I can use to copy the transformed exe.config from work folder(C:\Octopus\Work\20200318095445-750-140(timestamp)) as I checked and the transformation is working in the package under work folder.
Hi Kenneth, thanks a lot for your help. this is working now. One mistake I was doing was that I was not using this feature in ''Deploy A Package" step but in some later steps where a powershell script runs and powershell script extracts the package again in work folder temporarily and configuration transform was getting applied there. Another thing I noticed is that file name is case-sensitive so it should be Release.config not release.config.
Thanks for following up, and you’re more than welcome! Great to hear you’ve managed to get it working now, and thanks for letting me know the cause of this. If you have any questions or concerns in the future, please don’t hesitate to reach out.