Release Application Version

JFrog REST APIs

Content Type
REST API

Description: Releases the specified application version by moving it to the PROD stage.

Since: AppTrust 1.16.4

Usage: POST https://{{artifactory-host}}/apptrust/api/v1/applications/{{application_key}}/versions/{{version}}/release

Query Parameters (optional):

Parameter

Type

Description

async

boolean

Determines whether the operation should be asynchronous (true) or synchronous (false).

The default value is false, which means that Artifactory waits for application version promotion to complete before allowing you to move on to the next task.

Request Body:

Parameter

Type

Description

promotion_type

string

The type of release to perform:

  • copy: Copies the application version to the target stage, preserving the source artifacts. This is the default.

    Note

    No physical copy occurs if the source and target repositories are identical.

  • move: Moves the application version to the target stage, transferring the source.

  • dry_run: Simulates the release without actually performing it.

included_repository_keys

array:string

Use this option to include only the specified repository keys in the promotion.

excluded_repository_keys

array:string

Use this option to exclude the specified repository keys from the promotion.

artifact_additional_properties

array:string

Key-value pairs that define properties to add to each promoted artifact on top of any existing properties.

Note

If a property with the same key already exists on the artifact, the value defined in artifact_additional_properties will override the previous value.

Consumes: application/json

Response Body:

Parameter

Type

Description

application_key

string

The unique application key.

version

string

The application version identifier.

source_stage

string

The source stage from which the application version was promoted.

status

string

The outcome of the request (for example, success).

message

string

A human-readable summary of the outcome.

included_repository_keys

array:string

Repository keys that were specifically included in the promotion.

excluded_repository_keys

array:string

Repository keys that were specifically excluded from the promotion.

artifact_additional_properties

array:string

Key-value pairs that were added as properties to the application version.

created

string

Timestamp of when the version was promoted (ISO 8601 standard).

evaluations

object

Contains the results of policy evaluations performed at the source and release stage gates.

evaluations.exit_gate

object

The evaluation result at the exit gate of the source stage.

evaluations.exit_gate_eval_id

string

The unique ID of the evaluation.

evaluations.exit_gate.stage

string

The name of the source stage.

evaluations.exit_gate.decision

string

The status of the evaluation at the source stage exit gate (pass, warn, fail).

evaluations.exit_gate.explanation

string

The summary of the exit gate evaluation outcome (omitted if the decision is pass).

evaluations.release_gate

object

The evaluation result at the entry gate of the target stage.

evaluations.release_gate.eval_id

string

The unique ID of the evaluation.

evaluations.release_gate.stage

string

The name of the target stage.

evaluations.release_gate.decision

string

The status of the evaluation at the release gate (pass, warn, fail).

evaluations.release_gate.explanation

string

The summary of the release gate evaluation outcome (omitted if the decision is pass).

Sample Request:

POST 'https://{host}.jfrog.io/apptrust/api/v1/applications/my-web-app/versions/1.2.0/release
Content-Type: application/json
Authorization: ••••••

{
  "promotion_type": "copy",
  "included_repository_keys": [
    "docker-prod-local"
  ],
  "artifact_additional_properties": {
    "release.status": "approved",
    "promoted.by": "jane.doe"
  }
}

Sample Response (success):

{
  "application_key": "my-web-app",
  "version": "1.2.0",
  "source_stage": "staging",
  "promotion_type": "copy",
  "status": "success",
  "message": "Releasing version using Copy from 'staging' was successful.",
  "included_repository_keys": [
    "docker-prod-local"
  ],
  "excluded_repository_keys": [],
  "artifact_additional_properties": {
    "release.status": "approved",
    "promoted.by": "jane.doe"
  },
  "created": "2023-10-27T10:00:00Z",
  "evaluations": {
    "exit_gate": {
      "eval_id": "eval_src_1698399600",
      "stage": "staging",
      "decision": "pass"
    },
    "release_gate": {
      "eval_id": "eval_tgt_1698399605",
      "stage": "PROD",
      "decision": "pass"
    }
  }
}

Sample Response (failure):

{
  "message": "Releasing using copy promotion from 'staging' failed due to policy violations.",
  "promotion_type": "copy",
  "details": [
    {
      "gate": "exit_gate",
      "eval_id": "eval_src_1698399799",
      "status": "passed",
      "failed_policies": []
    },
    {
      "gate": "release_gate",
      "eval_id": "eval_tgt_1698399800",
      "status": "failed",
      "failed_policies": [
        {
          "policy_name": "Block Critical Vulnerabilities",
          "reason": "Artifact 'my-web-app:1.2.1/service.jar' contains 3 critical vulnerabilities."
        }
      ]
    }
  ]
}

Status Codes:

Code

Description

200

Promoted (synchronous)

202

Promoted (asynchronous)

400

Bad Request

401

Bad Credentials

403

Permission Denied

404

Not Found