Need help with other JFrog products?

JFrog Platform
JFrog Artifactory
JFrog Xray
JFrog Mission Control
JFrog Distribution
[JFrog Pipelines]
JFrog Access


Page tree
Skip to end of metadata
Go to start of metadata

Overview

This page describes how to use JFrog CLI with JFrog Distribution.

Read more about JFrog CLI here.

Syntax

When used with JFrog Distribution, JFrog CLI uses the following syntax:

$ jfrog ds command-name global-options command-options arguments

Managing Access Keys


Page Contents

Authentication

When used with JFrog Distribution, JFrog CLI offers several means of authentication: JFrog CLI does not support accessing  Distribution without authentication. 

Authenticating with Username and Password

To authenticate yourself using your JFrog login credentials, configure your credentials once using the jfrog c add command or provide the following option to each command.

Command optionDescription 
--urlJFrog Distribution API endpoint URL. It usually ends with /distribution
--userJFrog username
--passwordJFrog password

Authenticating with an Access Token

To authenticate yourself using a JFrog Access Token, either configure your Access Token once using the jfrog c add command or provide the following option to each command.

Command optionDescription 
--urlJFrog Distribution API endpoint URL. It usually ends with /distribution
--access-tokenJFrog access token



Commands

The following sections describe the commands available in the JFrog CLI for use with JFrog Distribution. 

Creating or updating an unsigned Release Bundle

This commands creates and updates an unsigned Release Bundle on JFrog Distribution.

This commands require version 2.0 or higher of JFrog Distribution.

Command-name

release-bundle-create / release-bundle-update

Abbreviation

rbc / rbu

Command options

--server-id

[Optional]

Artifactory server ID configured using the config command.

--spec

[Optional]

Path to a file spec. For more details, please refer to Using File Specs.

--spec-vars

[Optional]

List of variables in the form of "key1=value1;key2=value2;..." to be replaced in the File Spec. In the File Spec, the variables should be used as follows: ${key1}.

--target-props

[Optional]

The list of properties, in the form of key1=value1;key2=value2,..., to be added to the artifacts after distribution of the release bundle.

--target

[Optional]

The target path for distributed artifacts on the edge node. If not specified, the artifacts will have the same path and name on the edge node, as on the source Artifactory server. For flexibility in specifying the distribution path, you can include placeholders in the form of {1}, {2} which are replaced by corresponding tokens in the pattern path that are enclosed in parenthesis. 

--dry-run

[Default: false]

Set to true to disable communication with JFrog Distribution.

--sign

[Default: false]

If set to true, automatically signs the release bundle version.

--passphrase

[Optional]

The passphrase for the signing key.

--desc

[Optional]

Description of the release bundle.

--release-notes-path

[Optional]

Path to a file describes the release notes for the release bundle version.

--release-notes-syntax

[Default: plain_text]

The syntax for the release notes. Can be one of markdown, asciidoc, or plain_text.

--exclusions

[Optional]

A list of Semicolon-separated exclude path patterns, to be excluded from the Release Bundle. Allows using wildcards.

--repo

[Optional]

A repository name at source Artifactory to store release bundle artifacts in. If not provided, Artifactory will use the default one.

--insecure-tls

[Default: false]

Set to true to skip TLS certificates verification.

--detailed-summary

[Default: false]

Set to true to return the SHA256 value of the release bundle manifest.

Command arguments


release bundle name

The name of the release bundle.

release bundle version

The release bundle version.

pattern

Specifies the source path in Artifactory, from which the artifacts should be bundled, in the following format: <repository name>/<repository path>. You can use wildcards to specify multiple artifacts. This argument should not be sent along with the --spec option.

Examples
Example 1

Create a release bundle with name myApp and version 1.0.0. The release bundle will include the files defined in the File Spec specified by the --spec option.

jfrog ds rbc --spec=/path/to/rb-spec.json myApp 1.0.0
Example 2

Create a release bundle with name myApp and version 1.0.0. The release bundle will include the files defined in the File Spec specified by the --spec option. GPG sign the release bundle after it is created.

jfrog ds rbc --spec=/path/to/rb-spec.json --sign myApp 1.0.0
Example 3

Update the release bundle with name myApp and version 1.0.0. The release bundle will include the files defined in the File Spec specified by the --spec option.

jfrog ds rbu --spec=/path/to/rb-spec.json myApp 1.0.0
Example 4

Update the release bundle with name myApp and version 1.0.0. The release bundle will include all the zip files inside the zip folder, located at the root of the my-local-repo repository.

jfrog ds rbu myApp 1.0.0 "my-local-repo/zips/*.zip"
Example 5

Update the release bundle with name myApp and version 1.0.0. The release bundle will include all the zip files inside the zip folder, located at the root of the my-local-repo repository. The files will be distributed on the Edge Node to the target-zips folder, under the root of the my-target-repo repository.

jfrog ds rbu myApp 1.0.0 "my-local-repo/zips/*.zip" --target my-target-repo/target-zips/
Example 6

This example uses placeholders. It creates the release bundle with name myApp and version 1.0.0. The release bundle will include all the zip files inside the zip folder, located at the root of the my-local-repo repository. The files will be distributed on the Edge Node to the target-zips folder, under the root of the my-target-repo repository. In addition, the distributed files will be renamed on the Edge Node, by adding -target to the name of each file.

jfrog ds rbc myApp 1.0.0 "my-local-repo/zips/(*).zip" --target "my-target-repo/target-zips/{1}-target.zip"

Signing an Existing Release Bundle

This command GPG signs an existing Release Bundle on JFrog Distribution.

These commands require version 2.0 or higher of JFrog Distribution.

Command-name

release-bundle-sign

Abbreviation

rbs

Command options

--server-id

[Optional]

Artifactory server ID configured using the config command.

--passphrase

[Optional]

The passphrase for the signing key.

--repo

[Optional]

A repository name at source Artifactory to store release bundle artifacts in. If not provided, Artifactory will use the default one.

--insecure-tls

[Default: false]

Set to true to skip TLS certificates verification.

--detailed-summary

[Default: false]

Set to true to return the SHA256 value of the release bundle manifest.

Command arguments

release bundle name

The name of the release bundle.

release bundle version

The release bundle version.

Examples
Example 1

GPG sign the release bundle with name myApp and version 1.0.0.

jfrog ds rbs --passphrase="<passphrase>" myApp 1.0.0 

Distributing a Release Bundle

This command distributes a release bundle to the Edge Nodes.

These commands require version 2.0 or higher of JFrog Distribution.

Command-name

release-bundle-distribute

Abbreviation

rbd

Command options

--server-id

[Optional]

Artifactory server ID configured using the config command.

--sync

[Default: false]

Set to true to enable sync distribution (the command execution will end when the distribution process ends).

--max-wait-minutes

[Default: 60]

Max minutes to wait for sync distribution.

--dry-run

[Default: false]

Set to true to disable communication with JFrog Distribution.

--dist-rules

[Optional]

Path to a file, which includes the Distribution Rules in a JSON format.

Distribution Rules JSON 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": ["*"]
      }
    ]
}

--site

[Default: *]

Wildcard filter for site name.

--city

[Default: *]

Wildcard filter for site city name.

--country-codes

[Default: *]

Semicolon-separated list of wildcard filters for site country codes.

--insecure-tls

[Default: false]

Set to true to skip TLS certificates verification.

Command arguments

release bundle name

The name of the release bundle.

release bundle version

The release bundle version.

Examples
Example 1

Distribute the release bundle with name myApp and version 1.0.0. Use the distribution rules defined in the specified file.

jfrog ds rbd --dist-rules=/path/to/dist-rules.json myApp 1.0.0


Deleting a Release Bundle

This command deletes a Release Bundle from the Edge Nodes and optionally from Distribution as well.

These commands require version 2.0 or higher of JFrog Distribution.

Command-name

release-bundle-delete

Abbreviation

rbdel

Command options

--server-id

[Optional]

Artifactory server ID configured using the config command.

--sync

[Default: false]

Set to true to enable sync deletion (the command execution will end when the deletion process ends).

--max-wait-minutes

[Default: 60]

Max minutes to wait for sync deletion.

--dry-run

[Default: false]

Set to true to disable communication with JFrog Distribution.

--dist-rules

[Optional]

Path to a file, which includes the distribution rules in a JSON format.

--site

[Default: *]

Wildcard filter for site name.

--city

[Default: *]

Wildcard filter for site city name.

--country-codes

[Default: *]

Semicolon-separated list of wildcard filters for site country codes.

--delete-from-dist

[Default: false]

Set to true to delete release bundle version in JFrog Distribution itself after deletion is complete in the specified Edge nodes.

--quiet

[Default: false]

Set to true to skip the delete confirmation message.

--insecure-tls

[Default: false]

Set to true to skip TLS certificates verification.

Command arguments

release bundle name

The name of the release bundle.

release bundle version

The release bundle version.

Examples
Example 1

Delete the release bundle with name myApp and version 1.0.0 from the Edge Nodes only, according to the definition in the distribution rules file.

jfrog ds rbdel --dist-rules=/path/to/dist-rules.json myApp 1.0.0
Example 2

Delete the release bundle with name myApp and version 1.0.0 from the Edge Nodes, according to the definition in the distribution rules file. The release bundle will also be deleted from the Distribution service itself.

jfrog ds rbdel --delete-from-dist --dist-rules=/path/to/dist-rules.json myApp 1.0.0




  • No labels