How do I delete old release builds? ("Max release builds")

How do I delete old release builds? ("Max release builds")

AuthorFullName__c
JFrog Support
articleNumber
000001546
ft:sourceType
Salesforce
FirstPublishedDate
2016-10-06T13:35:56Z
lastModifiedDate
2024-03-10T07:48:53Z
VersionNumber
5

There are two categories to consider when we talk about deleting artifacts:  Handling artifacts that have already been deployed, and handling future deployments.
 

Handling the artifacts already deployed to Artifactory:

You can delete old builds by build number from the UI at artifacts tab ? tree browser, right click on a repository’s name, or browse deeper to the folder from which you want to delete recursively, and choose ‘delete versions’, this will open a menu with all relevant build versions to delete, mark the ones you want to delete.

 

You can also delete builds by version from the REST API with the ‘Delete build’ query.

 

Handling future builds:

In order to utilize a mechanism that deletes older releases as the ‘max unique snapshots’ does for snapshot versions, you could write your own ‘user plugin’ which would do the following:
  • Intercept artifact-deployments to Artifactory with the ‘afterCreate’ hook
  • Check if the deployment artifacts are from the relevant build (check the build.name and build.number properties)
  • Run the cleanup accordingly.