Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

How do I configure a retention rule that ensures that there is at least n versions of every package?



  • I am trying to configure a ProGet retention policy on a deployment package feed (used by Octopus Deploy). I am trying to set up a set of rules so that old or unused packages are cleaned but. That all works ok, but there is an additional requirement: I need to ensure that there are always at least n versions of a given package.

    The scenario is when you have a deployment package for a project that is fairly static. In this case, the package won't have been downloaded for perhaps many months, but if it gets cleaned up then we are kind of hosed when we need to add new servers, deploy again, etc.

    So what I want to build is a rule to delete packages older than X days that haven't been downloaded much, but make sure every package still has n versions. Is this possible, and if so, how?

    Thanks!

    Product: ProGet
    Version: 4.7.11


  • inedo-engineer

    Hello Erick,

    All of the conditions set in the retention rule must be met for the package to be deleted, so setting "delete old versions except the last n versions" and "delete unused versions not requested in the last X days" on the same rule will do what you want.



  • Thanks, that does make sense.

    For whatever reason, the documentation on this feature is a little bit confusing. I think it is because you can have multiple retention rules, and multiple conditions within each role. Does a package get excluded for cleanup if it matches more than one rule (as opposed to conditions in the rule)? Or does it need to match all rules?

    The answers are likely in the docs, but a few of us here read the docs and were still very unclear on what to do. Maybe some examples with multiple rules/conditions, and an explanation of the logic flow?

    Thanks,
    Erick


  • inedo-engineer

    Each rule separately checks that all of its conditions are met before deleting a package. If any of the rules decide to delete a package, the package is deleted.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation