Release Retention Without Keeping Package

Hello,

For various audit reasons we have the retention policy on our lifecycles set to keep releases for 30 days. We use TFS build tasks to create release notes that contain the changeset and the associated user stories. This allows us to see what changes have gone into each package / release.

What we would like to do is to be able to keep the Octopus releases beyond 30 days but not retain the packages. I.e. we won’t be re-deploying the releases but would use them for audit purposes.

Am I correct in thinking this isn’t possible at the moment aside from manually removing the packages from disk?

Hi,

Thanks for getting in touch!

Am I correct in thinking this isn’t possible at the moment aside from manually removing the packages from disk?

This is correct. If the release still exists, we consider it a candidate for re-deployment so we won’t delete the packages during the retention policy.

A possible approach would be to script this out like this:

  1. Use the Octopus API to get your releases (filtering by date, version or however you like) and the packages used on them. You could use Octoposh and the command Get-OctopusRelease for that, which will return an object like this for each release:
C:\Tools> Get-OctopusRelease -ProjectName Files -Version 2.0.17


ProjectName    : Files
Id             : Releases-5023
ReleaseVersion : 2.0.17
ReleaseNotes   :
CreationDate   : 05/05/2017 1:23:08 PM
CreatedBy      : dalmiro.granias@NY.local
Resource       : Octopus.Client.Model.ReleaseResource
Deployments    : {Deploy to Dev}
Packages       : {whatever}



C:\Tools> $r = Get-OctopusRelease -ProjectName Files -Version 2.0.17
C:\Tools> $r.Packages

Id       Version StepName
--       ------- --------
whatever 1.0.0   Deploy files

Cmdlet documentation: http://octoposh.readthedocs.io/en/latest/cmdlets/get-octopusrelease/

  1. Once you have the list of packages from (1), you could go ahead and script their deletion.

Let me know if that makes sense to you.

Regards,
Dalmiro

Hi Dalmiro,

Thank you for replying. Your idea does indeed make sense so I will look at putting together a script to do what I want.