Retention Policy on Multiple Deploys of the Same Package Version

Sometimes I have to do multiple deploys of the same package version (I might be tweaking my process or variables). It appears that the retention policy will consider this to be a single version (under c:\octopus\application\blah:

\1.0.0.0

\1.0.0.0_1

\1.0.0.0_2

Is that correct? If that is correct, could we change the behavior or add a retention behavior setting that says “count multiple installs of the same version against the retention policy”.

(The app I’m working on has an unfortunately large footprint and required being deployed to multiple servers, so the repeated cleanups is really bumming me out.)

Hi,

Thanks for getting in touch! It is correct. We have to assume that even though it is the same package it has different transforms and variables run, so the unpack needs to keep the files.
There is a bit more of an explanation here: http://docs.octopusdeploy.com/display/OD/Retention+policy+Tentacle+cleanup+and+troubleshooting
Keep in mind it’s mostly rare to use the Custom Installation Directory feature and most will point IIS to use those folders, thus only having a single copy.

I would suggest to keep your servers clean you could add a powershell (or scriptcs or bash you didn’t mention version) step to delete these folders and files to run at the end of the deployment and use the package directory variables for each step. It would be the only way to automate it. You could even scope this step to run on all but prod (keeping a backup on prod is always nice).

Unfortunately you cannot set any variable to not keep the very last release.
Hope this helps you find a solution,
Vanessa

I think part of the reason I am not seeing the expected retention behavior may be that I’m sometimes re-deploying the same release instead of creating a new release. The retention policy works off releases, and thus a failed deploy of the same release won’t count against the retention policy.

Hi,

That is very possible. You can confirm by looking at a deployment journal on one of your Tentacles. The doc page I linked to explains how to read what will be deleted.

Vanessa