Retention Rules
Enabling and Configuring Retention / Lifecycle policies
Automated retention/lifetime rules (available on the Velocity plan and above) allow you to automatically manage storage for packages by deleting or moving packages that fall outside of the defined retention rules. Assets can be expired based on the number of packages (count), the size of packages (bytes), or the number of days (time).
To enable and configure retention/lifecycle rules, click "Artifact Lifecycle" in the lefthand menu on a repository detail page, then use the sliders to set your policy, and finally click the green "Enable Lifecycle" button.
The retention rules are disjunctive, so it uses all three to select what to delete. Packages are deleted based on the date pushed, starting with the oldest.
If grouping is selected, it applies to the rules to each "grouping". Otherwise, it's across all packages within a repository.
If “Group Packages by Name” is selected, retention will apply to groups of packages by name rather than all packages. For example, when retaining by a count limit of 1 and you upload PkgA 1.0, PkgB 1.0 and PkgB 1.1; only PkgB 1.0 is deleted because there are two (2) PkgBs and one (1) PkgA
If “Group Packages by Format” is selected, retention will apply to packages within package types rather than across all package formats. For example, when retaining by a limit of 1 and you upload PythonPkg 1.0 and RubyPkg 1.0, no packages are deleted because they are different formats
Example - Retention Policy that deletes packages older than 100 days
To configure a retention / lifecycle policy that removes packages older than 100 days, you would set the following:
- "Limit By Days" = 100
- "Limit By Count" = 1000
- "Limit By Size" = 0.0B (disabled)
By disabling count and size, it means it only uses the package age to delete
Retention rules only activate when packages are uploaded (synchronised). So you could have one package at 1000 days, and the 90 days retention still wouldn't activate. Only after uploading a new package would the 1000 day package be deleted.
Updated 2 months ago