Hi i suspect this might be me not understanding the policys propperly but i am now starting to have an issue where my drives are filling up with old releases…
Repository status
Total packages stored 13423
Repository retention
Packages not used in a release will be automatically deleted from the repository after 5 days.
Packages used in a release will not be deleted unless the release is deleted.
In my lifecycles i have set that it should only keep 50 releases on the server and 2 on the tentacles…
Why is it keeping som many packages?
Thanks for reaching out. The amount of packages stored in your Octopus Server is not defined by your lifecycles config, but by your “Repository Retention” configuration.
You can learn more about it, and the diferences with the Lifecycle’s retention policies on this link: http://docs.octopusdeploy.com/display/OD/Retention+Policies . Read the whole doc, but pay special attention to the section “NuGet feed retention policy”
Yes. but as you can se in my precious post we have the repository retention set to 5 days… but looking at the files we still have files that are over 3 months old?
As explained in the doc above, Octopus will only delete Packages from the built-in repository if:
They fall into the retention policy rules. In this case they do because, like you said, your retention policy is set to delete packages older than 5 days, and you definitely have packages older than that.
They are not being used on a release that currently exists.
Now that second clause is why your packages are not being deleted. Lets say you use MyApp.1.0.0.nupkg on release 1.0.0 of your project. Even if that package is older than 5 days, Octopus won’t delete it as long as release 1.0.0 of your project exists
So the question is Why are the releases not getting deleted?. If you check the latest log you sent and look for the words “Last 50 items”, you’ll notice that all your projects are set to keep the last 50 releases. So all the packages used during those 50 releases will be kept, which could easily escalate to really high numbers.
The retention policies that decide whether or not a release should be deleted (the ones you have set to 50) are the ones under Library -> Lifecycles. Once you set a shorter lifespan for your releases, they will started getting marked to be deleted, and once the retention task runs It’ll delete them, along with those packages.