When deploying I have a couple of config files that I do transformations on. But after deploying I wan’t the transformations files to be deleted.
For example:
web.config
web.release.config
web.produktion.config
web.test.config
If i deploy this to produktion I want all the web.*.config files to be deleted after the transformation is done. Is there any way that I can make octopus handle this or do I have to put this in a powershell script?
Currently a PostDeploy.ps1 PowerShell script is needed to delete them. Tentacle can’t delete them automatically since it’s possible that people might have files named App..config that isn’t necessarily a transform file.
Yes, although with one limitation - Octopus could delete the transform files it has run, but it would leave behind transforms it hasn’t run (e.g., web.staging.config would be left behind when deploying to production, but web.production.config would be deleted).
A big +1 to this. The CMS we use automatically imports .config files in certain directories, so anything “left over” causes serious issues. I’d love to see a solution where there was a checkbox that controlled removing any .config files that matched a pattern like .config or similar.
I have added this to my PostDeply-file to remove all transformation files from the application directory get-childitem .\ -include *Test.config, *Stage.config, *Production.config -recurse | foreach ($_) {remove-item $_.fullname -force -whatif}