Distribute Application Version CLI

Distribute an application version to a remote target, such as an edge node, using the JFrog CLI.

This command distributes an application version to a distribution target, such as an edge node.

ParameterDescription
Command-nameversion-distribute
Abbreviationvdist
Command arguments:
application-keyThe application key defined for the application.
versionThe application version to distribute.
Command options:
--city[Optional] Wildcard filter for site city name. Mutually exclusive with --dist-rules.
--country-codes[Optional] Semicolon-separated(;) list of wildcard filters for site country codes. Country code doesn't expect country phone code, but codes in this format, for example, US, GB, or FR. Mutually exclusive with --dist-rules.
--create-repo[Default: false] Set to true to create the repository on the edge if it does not exist.
--dist-rules[Optional] Path to a file, which includes the distribution rules in a JSON format. Mutually exclusive with --site, --city, and --country-codes.
--mapping-pattern[Optional] Specify along with --mapping-target to distribute artifacts to a different path on the edge node. You can use wildcards to specify multiple artifacts. Must be provided together with --mapping-target.
--mapping-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 parentheses. Must be provided together with --mapping-pattern.
--site[Optional] Wildcard filter for site name. Mutually exclusive with --dist-rules.

Distribution Rules Structure in JSON File

{
  "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_name, city_name, and country_codes should not be empty. They may be either omitted or use wildcards.

Distribute Application Version Examples

Distribute an Application Version Example 1

Distribute the application named myApp with version 1.0.0. Use the distribution rules defined in the specified file.

jf apptrust version-distribute --dist-rules=/path/to/dist-rules.json myApp 1.0.0

Distribute an Application Version Example 2

Distribute the application 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 apptrust version-distribute --dist-rules=/path/to/dist-rules.json --mapping-pattern="(*)/source/(*)" --mapping-target="{1}/target/{2}" myApp 1.0.0

Frequently Asked Questions

Common questions about distributing an application version.

plusFAQs
Q: How do I distribute an application version to an edge node using the JFrog CLI?

A: Run jf apptrust version-distribute (alias vdist) with the application key and version, optionally with a distribution filter such as --dist-rules, --site, --city, or --country-codes to narrow which edge nodes receive it. See the distribution examples.

Q: What happens if I set --mapping-pattern without --mapping-target?

A: The command requires both options together. --mapping-pattern and --mapping-target must be provided as a pair to remap artifact paths on the edge node.

Q: Can I create the target repository on the edge node automatically?

A: Yes. Pass --create-repo=true to create the repository on the edge node if it doesn't already exist.

Q: What do site_name, city_name, and country_codes do in a distribution rules file?

A: They filter which edge nodes receive the distribution and should not be empty — each field can be omitted or use a wildcard (*) instead. See the distribution rules structure.

Q: What do I need before distributing an application version remotely?

A: You need the target application's application-key and version. You can optionally narrow the distribution with a filter such as --dist-rules, --site, --city, or --country-codes.

Related Topics



Did this page help you?