Description: Removes builds stored in Artifactory. Useful for cleaning up old build info data.
Notes: Requires Artifactory Pro
Security: Requires a privileged user. From version 6.6, requires delete permission for the Build.
Produces: application/text
Usage 1 (since 6.13): to delete multiple build numbers of a certain build. This includes build numbers containing special characters.
Consumes: application/json
POST /api/build/delete
POST /api/build/delete -H "Content-type: application/json" { "project": "catalina", "buildName": "test", "buildNumbers": ["build1", "build2"], "deleteArtifacts": <true | false>, "deleteAll": <true | false>, }
The request includes the following information:
Property | Mandatory | Type | Description |
---|---|---|---|
| optional | string | The project to which the build belongs. If a project is not specified, the default project is used. |
| mandatory | string | The build name. |
| optional | array | The build numbers to delete. This property can be left undefined if |
| optional | boolean | When set to The default value is |
| optional | boolean | When set to The default value is |
Note
When deleteArtifacts
is set to true
, the artifacts to be deleted are located according to the following build properties: build.name
, build.number
, build.timestamp
.
Certain build integration tools (for example, Jenkins) might generate
build.timestamp
values that are inconsistent with thestarted
value in the build-info. In such cases, the deletion process will check whether the same build and build number exist in another project:If they are found, the artifacts will not be deleted.
If they are not found, the artifacts will be deleted based on their SHA and the following build properties:
build.name
andbuild.number
. Thebuild.timestamp
property is ignored due to the inconsistencies.
If the artifacts were promoted or copied to another target, they will also be deleted from those locations.
Usage 2 (since 2.3.0; artifact removal since 2.3.3):
DELETE /api/build/{buildName}[?buildNumbers=n1[,n2]][&artifacts=0/1][&deleteAll=0/1]
DELETE /api/build/my-build?buildNumbers=51,52,55&artifacts=1 The following builds has been deleted successfully: 'my-build#51', 'my-build#52', 'my-build#55'. DELETE /api/build/my-build?deleteAll=1 All 'my-build' builds have been deleted successfully.