This page describes how to use JFrog CLI with Release Lifecycle Management.
Note
Release Lifecycle Management is only available since Artifactory 7.63.2.
When used with JFrog Release Lifecycle Management, JFrog CLI uses the following syntax:
$ jf command-name global-options command-options arguments
The create command allows creating a release bundle using file specs. The file spec may be of one of the following creation sources:
-
Published build infos.
{ "files": [ { "build": "<build-name>/<build-number>", "includeDeps": "[true/false]", "project": "<project-key>" }, ... ] }<build-number>is optional, latest build will be used if empty.includeDepsis optional, false by default.projectis optional, default project will be used if empty. -
Existing release bundles.
{ "files": [ { "bundle": "<bundle-name>/<bundle-version>", "project": "<project-key>" }, ... ] }projectis optional, default project will be used if empty. -
A pattern of artifacts in Artifactory.
{ "files": [ { "pattern": "repo/path/*", "exclusions": ["excluded",...], "props": "key1=value1;key2=value2;key3=value3", "excludeArtifacts": "key1=value1;key2=value2;key3=value3", "recursive": "[true/false]" }, ... ] }Only
patternis mandatory.recursiveis true by default. -
AQL query.
{ "files": [ { "aql": { "items.find": { "repo": "<repo>", "path": "<path>", "name": "<file>" } } } ] }Only a single AQL query may be provided.
| Command-name | release-bundle-create |
| Abbreviation | rbc |
| Command arguments: | |
| release bundle name | Name of the newly created Release Bundle. |
| release bundle version | Version of the newly created Release Bundle. |
| Command options: | |
--project |
[Optional] |
--server-id |
[Optional] |
--signing-key |
[Optional] |
--spec |
[Optional] |
--spec-vars |
[Optional] |
--sync |
[Default: false] |
Create a release bundle with name "myApp" and version "1.0.0", using signing key pair "myKeyPair". The release bundle will include artifacts corresponding to the creation source in the provided file spec.
jf rbc --spec=/path/to/spec.json --signing-key=myKeyPair myApp 1.0.0
Create a release bundle synchronously, in project "project0".
jf rbc --spec=/path/to/spec.json --signing-key=myKeyPair --sync=true --project=project0 myApp 1.0.0
Create a release bundle using file spec variables.
jf rbc --spec=/path/to/spec.json --spec-vars="key1=value1" --signing-key=myKeyPair myApp 1.0.0
This command allows promoting a release bundle to a target environment.
| Command-name | release-bundle-promote |
| Abbreviation | rbp |
| Command arguments: | |
| release bundle name | Name of the Release Bundle to promote. |
| release bundle version | Version of the Release Bundle to promote. |
| environment | Name of the target environment for the promotion. |
| Command options: | |
--input-repos |
[Optional] |
--exclude-repos |
[Optional] |
--project |
[Optional] |
--server-id |
[Optional] |
--signing-key |
[Optional] |
--sync |
[Default: false] |
Promote a release bundle named "myApp" version "1.0.0" to environment "PROD". Use signing key pair "myKeyPair".
jf rbp --signing-key=myKeyPair myApp 1.0.0 PROD
Promote a release bundle synchronously to environment "PROD". The release bundle is named "myApp", version "1.0.0", of project "project0". Use signing key pair "myKeyPair".
jf rbp --signing-key=myKeyPair --project=project0 --sync=true myApp 1.0.0 PROD
Promote a release bundle while including certain repositories.
jf rbp --signing-key=myKeyPair --include-repos="generic-local;my-repo" myApp 1.0.0 PROD
Promote a release bundle while excluding certain repositories.
jf rbp --signing-key=myKeyPair --exclude-repos="generic-local;my-repo" myApp 1.0.0 PROD
This command distributes a release bundle to an edge node.
| Command-name | release-bundle-distribute |
| Abbreviation | rbd |
| Command arguments: | |
| release bundle name | Name of the release bundle to distribute. |
| release bundle version | Version of the release bundle to distribute. |
| Command options: | |
--city |
[Default: *] |
--country-codes |
[Default: *] |
--create-repo |
[Default: false] |
--dist-rules |
[Optional] |
--dry-run |
[Default: false] |
--mapping-pattern |
[Optional] |
--mapping-target |
[Optional] |
--max-wait-minutes |
[Default: 60] |
--project |
[Optional] |
--server-id |
[Optional] |
--site |
[Default: *] |
--sync |
[Default: false] |
Distribution Rules Structure
{
"distribution_rules": [
{
"site_name": "DC-1",
"city_name": "New-York",
"country_codes": ["1"]
},
{
"site_name": "DC-2",
"city_name": "Tel-Aviv",
"country_codes": ["972"]
}
]
}The Distribution Rules format also supports wildcards. For example:
{
"distribution_rules": [
{
"site_name": "",
"city_name": "",
"country_codes": ["*"]
}
]
}Distribute the release bundle named myApp with version 1.0.0. Use the distribution rules defined in the specified file.
jf rbd --dist-rules=/path/to/dist-rules.json myApp 1.0.0
Distribute the release bundle named myApp with version 1.0.0 using the default distribution rules.
Map files under the source directory to be placed under the target directory.
jf rbd --dist-rules=/path/to/dist-rules.json --mapping-pattern="(*)/source/(*)" --mapping-target="{1}/target/{2}" myApp 1.0.0
Synchronously distribute a release bundle associated with project "proj"
jf rbd --dist-rules=/path/to/dist-rules.json --sync --project="proj" myApp 1.0.0
This command allows deleting all release bundle promotions to an environment or deleting a release bundle locally altogether. Deleting locally means distributions of the release bundle will not be deleted.
| Command-name | release-bundle-delete-local |
| Abbreviation | rbdell |
| Command arguments: | |
| release bundle name | Name of the release bundle to distribute. |
| release bundle version | Version of the release bundle to distribute. |
| environment | If provided, all promotions to this environment are deleted. Otherwise, the release bundle is deleted locally with all its promotions. |
| Command options: | |
--project |
[Optional] |
--quiet |
[Default: $CI] |
--server-id |
[Optional] |
--sync |
[Default: false] |
Locally delete the release bundle named myApp with version 1.0.0 altogether.
jf rbdell myApp 1.0.0
Delete a release bundle locally altogether. Run the command synchronously and skip the confirmation message.
jf rbdell --quiet --sync myApp 1.0.0
Delete all promotions of the release bundle to environment "PROD".
jf rbdell myApp 1.0.0 PROD
This command will delete distributions of a release bundle from edge nodes.
| Command-name | release-bundle-delete-remote |
| Abbreviation | rbdelr |
| Command arguments: | |
| release bundle name | Name of the release bundle to distribute. |
| release bundle version | Version of the release bundle to distribute. |
| Command options: | |
--city |
[Default: *] |
--country-codes |
[Default: *] |
--dist-rules |
[Optional] |
--dry-run |
[Default: false] |
--max-wait-minutes |
[Default: 60] |
--project |
[Optional] |
--quiet |
[Default: $CI] |
--server-id |
[Optional] |
--site |
[Default: *] |
--sync |
[Default: false] |
Delete the distributions of release bundle named myApp with version 1.0.0 from edge nodes matching the provided distribution rules defined in the specified file.
jf rbd --dist-rules=/path/to/dist-rules.json myApp 1.0.0
Delete the distributions of the release bundle associated with project "proj" from the provided edge nodes. Run the command synchronously and skip the confirmation message.
jf rbd --dist-rules=/path/to/dist-rules.json --project="proj" --quiet --sync myApp 1.0.0
JFrog Lifecycle Management supports distributing your Release Bundles to remote Edge nodes within an air-gapped environment. This use case is mainly intended for organizations that have two or more JFrog instances that have no network connection between them.
The following command allows exporting a Release Bundle as an archive to the filesystem that can be transferred to a different instance in an air-gapped environment.
| Command-name | release-bundle-export |
| Abbreviation | rbe |
| Command arguments: | |
| release bundle name | Name of the Release Bundle to export. |
| release bundle version | Version of the release bundle to export. |
| target pattern | The argument is optional and specifies the local file system target path.If the target path ends with a slash, the path is assumed to be a directory.For example, if you specify the target as "repo-name/a/b/", then "b" is assumed to be a directory into which files should be downloaded.If there is no terminal slash, the target path is assumed to be a file to which the downloaded file should be renamed.For example, if you specify the target as "a/b", the downloaded file is renamed to "b". |
| Command options: | |
--project |
[Optional] |
--server-id |
[Optional] |
| mapping-pattern | [Optional] |
| mapping-target | [Optional] |
| split-count | [Optional] |
| min-split | [Optional] |
Export release bundle named "myApp" and version 1.0.0
jf rbe myApp 1.0.0
Download to a specific location
jf rbe myApp 1.0.0 /user/mybundle/
Import a Release Bundle archive from a release bundle exported zip file.
Please note this functionality only works on Edge nodes within an air-gapped environment.
| Command-name | release-bundle-import |
| Abbreviation | rbi |
| Command arguments: | |
| path to archive | Path to the release bundle archive on the filesystem |
| Command options: | |
--project |
[Optional] |
--server-id |
[Optional] |
Import a Release Bundle named "myExportedApp" and version 1.0.0
jf rbi ./myExportedApp.zip