Description: Change the status of a build, optionally moving or copying the build's artifacts and its dependencies to a target repository and setting properties on promoted artifacts.
All artifacts from all scopes are included by default while dependencies are not. Scopes are additive (or). From version 5.7, the target repository can be a virtual repository.
Since: 2.3.3
Security: Requires a privileged user. From version 6.6, requires Deploy permission for the build.
Usage: POST /api/build/promote/{buildName}/{buildNumber} -H "Content-Type: application/json" --upload-file build-promotion.json
Query parameters (optional):
Field | Type | Description |
---|---|---|
| string | The name of the project that contains the build to be promoted. If not defined, Artifactory uses the default build-info repo. |
Consumes: application/json (application/vnd.org.jfrog.artifactory.build.PromotionRequest+json)
POST /api/build/promote/my-build/51 { "status": "staged", "comment" : "Tested on all target platforms.", "ciUser": "builder", "timestamp" : ISO8601, "dryRun" : false, "sourceRepo" : "libs-snapshot-local", "targetRepo" : "libs-release-local", "copy": false, "artifacts" : true, "dependencies" : false, "scopes" : [ "compile", "runtime" ], "comment" : "Tested on all target platforms.", "ciUser": "builder", "timestamp" : ISO8601, "dryRun" : false, "sourceRepo" : "libs-snapshot-local", "targetRepo" : "libs-release-local", "copy": false, "artifacts" : true, "dependencies" : false, "scopes" : [ "compile", "runtime" ], "properties": { "components": ["c1","c3","c14"], "release-name": ["fb3-ga"] }, "failFast": true }
The request includes the following information:
Property | Mandatory | Type | Description |
---|---|---|---|
| optional | string | The new status of the build. This is especially important when performing a promotion that only changes the status of the build without copying or moving artifacts and dependencies. If the
|
| optional | string | An optional comment describing the reason for the promotion. |
| mandatory | string | The user that invoked promotion from the CI server. |
| mandatory | date and time | The time when the promotion command was received by Artifactory (ISO8601 format). The format is: 'yyyy-MM-dd'T'HH:mm:ss.SSSZ'. Example: '2016-02-11T18:30:24.825+0200'. |
| mandatory | boolean | When set to The default value is |
| optional | string | The repository from which the build contents will be copied or moved. If this property is not defined, the source repository is resolved automatically. |
| optional | string | The target repository to which the build contents will be copied or moved. This property does not need to defined if the promotion involves a change of status only. |
| mandatory | boolean | Determines how to perform the build promotion:
The default value is |
| mandatory | boolean | Determines whether to move/copy the build's artifacts. The default value is |
| mandatory | boolean | Determines whether to move/copy the build's dependencies. The default value is |
| optional | array | An array of dependency scopes that indicate the circumstances under which a dependency is available. Relevant when dependencies is set to |
| optional | array | A list of properties to attach to the build's artifacts (regardless of whether a |
| mandatory | boolean | When set to The default value is |
Produces: application/json (application/vnd.org.jfrog.artifactory.build.PromotionResult+json)
Sample Output:
{ "messages" : [ { "level": "error", "message": "The repository has denied...." },... ] }
Status Codes:
Code | Description |
---|---|
200 | Success |
401 | Bad Credentials |
403 | Permission Denied |
404 | Not Found |