We are running the most current version of octopus… And as part of the upgrade we were hoping the retention policy changes would resolve one of issues, but it does not appear to…
We we want the tentacle to have a retention policy of zero. For security reasons we don’t want anything stored in the octopus tentacle directory. When we deploy to the website we do things like encrypt the web.config and that is not encrypted in the tentacle directory
But you can not set either the retention policy of number or days to zero. It appears to change, but when you go back to look at the lifecycle it is not changed
What do people do to immediately remove the tentacle data . We have written a powershell script… But that breaks every time we upgrade octopus as that structure changes.
Thanks for getting in touch! We do not really have a zero retention policy. Even when it is set to 1 it keeps 3 copies (current, previous then 1).
There are a few ways to delete files after a deployment, and you could add a script that also does it. They use our output variables to get the path that as just released to.
Octopus.Action[StepName].Output.Package.InstallationDirectoryPath (where the step name is your package step name) gives you the dynamic path where the last package was uninstalled.
So you could have a script to delete this or use the following library script: https://library.octopusdeploy.com/#!/step-template/actiontemplate-file-system-clean-directory
Does this help?
That is what we had been doing… But during upgrades the scripts have been breaking as the tentacle has been changing the location of where the package gets expanded… I guess this is what we will continue to do…
The variable I mentioned allows you to find the path where the expansion happened.
It means you can then script it. Similar to how the step template I linked works (it also mentions the same variable).
Octopus.Action[StepName].Output.Package.InstallationDirectoryPath says - get me the extraction path for the package that was used in the step I named.
It shouldn’t break if that is used.