How do I create build retention, or discard old builds, without using a CI server?

How do I create build retention, or discard old builds, without using a CI server?

AuthorFullName__c
JFrog Support
articleNumber
000001218
ft:sourceType
Salesforce
FirstPublishedDate
2016-10-06T13:35:27Z
lastModifiedDate
2024-03-10T07:48:24Z
VersionNumber
5

 

If you wish to create build retention, or discard old builds without using a Continuous Integration tool, you can either write a simple script or a simple user plugin using the following guidelines:

 

Script, using the REST API:

     

    User Plugin, using our Public API:

    • Run an 'All-Builds' call if you want to go over all of the builds, or use the 'Build Runs' call, if that you want a specific build.

    • Calculate the current time minus the ‘lastStarted’ time (on the All Builds call) or the ‘started’ time (on the Build Runs call) from the JSON response.

    • Delete the builds that passed the time that you wish to keep by using the Delete Builds REST call.

      1. Use Get Builds method to get a list of the builds.

      2. Calculate the time since the build run until current time.

      3. Delete the builds that are passed the time that you wish to keep using the ‘deleteBuild’ method.