Retention Policies

Hi Octopus

We use the built in repository for packages and running out of space on the server, I’m trying to understand retention policies. You’ve got lots of great docs but can’t quite see what I need.

e have a retention policy set to 90 days but I believe no packages ever get removed. From what I understand, is this because ever package is linked to a release?

Can you set retention polices on Releases inside a project? As again, it seems to be an ever increasing list. I think this is the route cause. We keep creating releases and keeping every release since day 1. Every package is linked so can’t be deleted.

The only way I can think is a custom script to query every project, then every release, and apply a manual retention policy. But was hoping there is a Octopus feature somewhere…

Hi Chris,

Thanks for getting in touch! It looks like you’re right on the money in regards to the packages not being deleted since they’re in use by existing releases. You can set the release retention on the relevant lifecycle a project uses to automate the deletions of releases as shown in the following section in our docs. This page also shows how to configure different settings per lifecycle phase.

This release retention is run during deployments, where the package retention is run as a scheduled task every 4 hours. If releases get deleted during a deployment, the next package retention task will delete any packages that were used by those deleted releases (assuming the package isn’t also used in another existing release).

I hope that helps! Let me know how you go, or if you have any further questions going forward. :slight_smile:

Best regards,

Kenny

oh that’s interesting. I read release retention as “when does it delete the previous folders on the agents”, rather than removing them from the server.

I have a lifecycle set like:

when I deploy I see it cleaning from the tentacles:
image

So I know the tentacles get cleaned.

But I only expect to see 10 releases in the project > releases, but I have every release every created as far as I can tell.

I may be misunderstanding the caveats in the docs around “on the dashboard” and “4th stage”. For us, not every release gets deployed to every environment in the lifecycle stage, not every release gets to the final stage, the dashboard does not show every release.

On a deployment, should I see a step saying "Applying retention policy on Octopus Server…)?