Promote Application Version CLI

Description: Promotes the application version to the desired stage, with options for including/excluding repositories, running conditions, and adding comments.

Command:

jf apptrust version-promote <app-key> <version> <target-stage> [command options]

Alias command: jf at vp

Command Options

Option

Required/Optional

Type

Description

<app-key>

required

string

The application key of the application for which the version is being created.

<version>

required

string

The version number to assign to the application version in SemVer format.

<target-stage>

required

string

The stage to which the application version should be promoted (for example, DEV, QA, STG).

--sync <true|false>

optional

boolean

Determines whether to perform the promotion synchronously or asynchronously.

The default value is false (asynchronous), which means that Artifactory does not wait for application version promotion to complete before allowing you to move on to the next task.

--promotion-type

optional

string

The type of promotion to perform:

Specifies the promotion type:

  • 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.

--props "<key>=<value1>[,<value2>,...]"

optional

object

Defines a semicolon-separated list of properties to be added to each artifact in the application version.

The format is: 'key1=value1;key2=value2;...'

--dry-run

optional

boolean

When set to true, simulates the promotion without actually performing it. The default value is false.

--exclude-repos

optional

array:string

A list of semicolon-separated (;) repositories to exclude from the promotion. The default is false.

--include-repos

optional

array:string

A list of semicolon-separated (;) repositories to include in the promotion.

If this property is not defined, all repositories (except those explicitly excluded) are included in the promotion.

If one or more repositories are specifically included, all other repositories are excluded.

--overwrite-strategy

optional

string

Determines whether artifacts can be overwritten during promotion. This is a strategy for handling target artifacts with the same path but different checksums and is an exception to the general immutability of artifacts. Policy options:

  • latest: Default. Overwrite is permitted only if the artifact tag is latest. This option is intended primarily for artifacts that make use of the latest tag.
  • all: Overwriting of artifacts of any path is permitted.
  • disabled: No overwriting is permitted. This is the strongest option for preserving immutability during promotion.

If you chose keep as the promotion_type, the overwrite_policy parameter will be ignored.

Example 1: Promote an application version

This command promotes an application version to the QA stage.

jfrog app version-promote APP001 1.0.0 QA

Output (error):

{
   "message": "Failed to promote version.",
   "error": "<error-message>"
}

Example 2: Promote an application version with optional flags:

This command performs a copy promotion in synchronous mode, while excluding repoA and repoB from the promotion.

jfrog app version-promote APP001 1.0.0 DEV --sync true --exclude-repos "repoA;repoB" --promotion-type copy

Example 3: Perform a dry-run promotion:

This command simulates a promotion to the QA stage:

jfrog app version-promote APP001 1.0.0 QA --dry-run true