DISTRIBUTION: How to create and promote a release bundle v2 from builds and artifacts

DISTRIBUTION: How to create and promote a release bundle v2 from builds and artifacts

AuthorFullName__c
Rasul Imanov
articleNumber
000006330
FirstPublishedDate
2025-01-15T07:39:08Z
lastModifiedDate
2025-05-21
VersionNumber
1
This guide will be going over the steps that are required to easily create and promote a release bundle v2. 

Firstly, we will need to upload our GPG key to Artifactory. We may do so following this article


Once the GPG key has been uploaded to Artifactory, we can move forward with creating the release bundle via this REST API. 


Below is an example execution of creating a new Release Bundle from an artifact
curl --location 'https://<artifactory-URL>/lifecycle/api/v2/release_bundle' --header 'X-JFrog-Signing-Key-Name: <gpgkey-name> --header 'Content-Type: application/json' --header 'Authorization: Bearer <token>' --data '{
    "release_bundle_name": "rasuli-test",
    "release_bundle_version": "1",
    "source_type": "artifacts",
    "source": {
        "artifacts": [
            {
                "path": "Debian-local/ubuntu/pool/main/a/a11y-profile-manager/a11y-profile-manager-doc_0.1.10-0ubuntu3_all.deb",
                "sha256": "ec5354e806deed621283cc5697300777969abf95b846800690de67ff0fda40e8"
            }
        ]
    }
}'
RESULT: 
{
  "repository_key" : "release-bundles-v2",
  "release_bundle_name" : "rasuli-test",
  "release_bundle_version" : "1",
  "created" : "2025-01-02T19:21:29.630Z"

Below is an example execution of creating a new Release Bundle from a build:
curl --location 'https://<artifactory-URL>/lifecycle/api/v2/release_bundle' --header 'X-JFrog-Signing-Key-Name: <gpgkey-name> --header 'Content-Type: application/json' --header 'Authorization: Bearer <token>' --data '{
    "release_bundle_name": "rasuli-test",
    "release_bundle_version": "2",
    "source_type": "builds",
    "source": {
        "builds": [
            {
               "build_name": "test-build",
               "build_number": "1",
               "build_repository": "artifactory-build-info",
               "include_dependencies": false
            }
        ]
    }
}'
RESULT:
{
  "repository_key" : "release-bundles-v2",
  "release_bundle_name" : "rasuli-test",
  "release_bundle_version" : "2",
  "created" : "2025-01-08T18:40:51.638Z"
}%

Now we should see the release bundle created in the UI under Application > Artifactory > Release Lifecycle.

To promote the bundles, we can run the below REST API endpoint
curl --location 'https://<artifactory-URL>/lifecycle/api/v2/promotion/records/rasuli-test/1' \
--header 'X-JFrog-Signing-Key-Name: <gpgkey-name> \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
    "environment": "RELEASE",
    "included_repository_keys": ["debian-test-rasuli"]
}'
RESULT:
{
  "repository_key" : "release-bundles-v2",
  "release_bundle_name" : "rasuli-test",
  "release_bundle_version" : "1",
  "environment" : "RELEASE",
  "included_repository_keys" : [ "debian-test-rasuli" ],
  "excluded_repository_keys" : [ "rasuli-test-generic" ],
  "created" : "2025-01-02T22:23:19.262Z",
  "created_millis" : 1735856599262
}%

The promotion process is similar for both.

This completes our guide on how to create and promote release bundle v2 for artifacts and builds.