Create Release Bundle v1 Version

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: Create a new Release Bundle v1 version.

Important

For information about creating a Release Bundle v2 version, see Create Release Bundle v2 Version.

Since: 1.0

Security: Authenticated users only. User must have matching Release Bundle writer permissions.

Usage:POST api/v1/release_bundle

Usage restrictions:

  • The {name} string is limited to 128 characters.

  • The {version} string is limited to 32 characters. The string LATEST is prohibited.

  • The {name} and {version} strings must begin with a letter or digit.

  • The {name} and {version} strings must consist only of letters, digits, underscores, periods, hyphens, and colons.

Request headers: X-GPG-PASSPHRASE - String - the passphrase for the signing key, if applicable

Consumes: application/json

cURL Example

$ curl -u user:password -H "Accept: application/json" -H "Content-Type: application/json" -H "X-GPG-PASSPHRASE: keysPassphrase" -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle" -T createbundle.json

createbundle.json

{
  "name": "",
  "version": "",
  "dry_run": true|false,
  "sign_immediately": true|false,
  "storing_repository": "repository-name"|null,
  "description": "",
  "release_notes": {
    "syntax": "markdown|asciidoc|plain_text",
    "content": ""
  }, 
  "spec": {
    "queries": [
      {
        "aql": "items.find({ \"repo\" : \"example-repo-local\" })",
        "query_name": "query-1",
        "mappings": [
          {
            "input": "regex",
            "output": "$1/$2"
          }
        ],
        "added_props": [
          {
            "key": "",
            "values": [""]
                  }
        ],
        "exclude_props_patterns": [ 
          "example_exclude_prop_pattern_1",
          "example_example_prop_pattern_2"
        ]
      }
    ]
  }
}

Field

Type

Required

Default Value

Since

Description

name

String

yes

N/A

1.0

Release bundle name

version

String

yes

N/A

1.0

Release bundle version

dry_run

Boolean

no

false

1.0

If true, only parses and validates.

Note: this parameter default was previously set to true in versions below 2.x.

sign_immediately

Boolean

no

false

1.2

If true, automatically signs the release bundle version.

storing_repository

String

no

null

1.3

A repository name at source Artifactory to store release bundle artifacts in. If not provided, Artifactory will use the default one (requires Artifactory 6.5 or later).

description

String

no

null

1.0

Description of the release bundle.

release_notes

String

no

null

1.0

Describes the release notes for the release bundle version.

release_notes.syntax

String

no

"plain_text"

1.0

The syntax for the release notes. Options include:

  • markdown

  • asciidoc

  • plain_text (default)

Warning

Starting with Distribution 2.26.1, users are restricted from adding HTML tags to release notes written in Markdown. This behavior is controlled by the enable-sanitize-release-notes configuration property, which by default is set to true.Distribution Application Config YAML File

To keep the platform safe against possible cross-site scripting (XSS) attacks, it is recommended to not change this setting.

release_notes.content

String

yes

N/A

1.0

The content of the release notes.

spec

Object

yes

N/A

1.0

Describes the specification by artifacts are gathered and distributed in this release bundle.

spec.source_artifactory_id

String

deprecated

N/A

2.0

spec.queries

List (Object)

yes

N/A

1.0

List of query objects to gather artifacts by.

spec.queries.aql

String

yes

N/A

1.0

AQL query for gathering the artifacts from Artifactory.

spec.queries.query_name

String

no

"query-{index}"

1.0

A name to be used when displaying the query object.

Note that the release bundle query name length must be between 2 and 32 characters long and must start with alphabetic character followed by an alphanumeric or '_-.:' characters only.

spec.queries.added_props

List (Object)

no

null

1.0

List of added properties which will be added to the artifacts after distribution of the release bundle

spec.queries.added_props.key

String

yes

N/A

1.0

Property key to be created or updated on the distributed artifacts.

spec.queries.added_props.values

List (String)

no

[ ]

1.0

List of values to be added to the property key after distribution of the release bundle

spec.queries.mappings

List (Object)

no

null

1.0

List of mappings, which are applied to the artifact paths after distribution of the release bundle

spec.queries.mappings.input

String

yes

N/A

1.0

Regex matcher for artifact paths.

spec.queries.mappings.output

String

yes

N/A

1.0

Replacement for artifact paths matched by the "input" matcher. Capture groups can be used as "$1".

spec.exclude_props_patterns

List (String)

no

null

2.5.0

List of patterns for Properties keys to exclude after distribution of the release bundle. This will not have an effect on the "added_props" properties.

Response status codes:

201 - Successfully created release bundle version

409 - Release bundle with same name and version already exists

X - Status code for error passed from Artifactory AQL

Response headers: N/A

Produces: application/json

Response

 {
        "name": "bundle-name",
        "version": "1.0",
        "state": "OPEN",
        "created": "2018-03-14T10:19:30.678Z",
        "artifacts": [
                {
                        "checksum": "0651d26f4cc6ed60cd9d273c440daf7617459d3f6e3d512188ff19d4933e4ff6",
                        "source_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
                        "target_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
                        "props": [
                                {
                                        "key": "conan.package.version",
                                        "values": [
                                                "1.0"
                                        ]
                                },
                                ...
                        ]
                },
                {
                        "xray_scan_info": {
                        "blocked": boolean.
                        "blocked_reason": string (null if not blocked)
                },
                ...
        ],
        "archived": false
}

NPM, Bower and NuGet Package Types

When working with package types such as NPM, Bower and NuGet, that require transitive dependencies, you will need to create two separate release bundles: 1. An artifacts release bundle, and 2. A dependencies release bundle.

You can generate the build.info using JFrog CLI and create the release bundles using the following dependency and artifact AQL queries:

Artifact AQL

builds.find({"name":"buileName", "number":"buildNumber"}).include("module.artifact.item")

Dependency AQL

builds.find({"name":"buildName", "number":"buildNumber"}).include("module.dependency.item")