The YAML schema for DistributeReleaseBundle native step is as follows:
An alphanumeric string (underscores are permitted) that identifies the step.
DistributeReleaseBundle for this step type.
Description of usage
| ||May specify a ReleaseBundle resource to be updated with the ||Optional|
In addition, these tags can be defined to support the step's native operation:
Description of usage
Controls whether this should be a dry run to test if the release bundle can distribute to the Edge nodes matching the distribution rule.
The default is true.
Declares collections of shell command sequences to perform for pre- and post-execution phases:
|Tag||Description of usage||Required/Optional|
|Commands to execute in advance of the native operation||Optional|
|Commands to execute on successful completion||Optional|
|Commands to execute on failed completion||Optional|
|Commands to execute on any completion||Optional|
The actions performed for the
onExecute phase are inherent to this step type and may not be overridden.
The following examples show how to configure a DistributeReleaseBundle step to distribute or for a dry run.
Distribute Input Release Bundle Edge Node
Distributes the input release bundle to the edge nodes defined in the distribution rule.
- This example requires an Artifactory Integration and a Distribution Integration.
- The Pipelines DSL for this example is available in this repository in the JFrog GitHub account.
Trigger a Dry Run
Triggers a dry run of the distribution.
Triggers Distribution and Updates Output Resource
Triggers a distribution and updates the output resource with the name and version of the input.
Same Step for Dry Runs and to Distribute
In this example, the same step is used for both dry runs and to distribute the release bundle to Edge Nodes. The dry_run variable may be set in the pipeline configuration section or step configuration or added as a run variable by an earlier step in the pipeline using add_run_variable.
How it Works
When you use the DistributeReleaseBundle native step in a pipeline, it performs the following functions in the background:
- Create the distribution payload (the JSON object that will be in the request to Distribution)
- curl $distributionUrl/api/v1/distribution/$releaseBundleName/$releaseBundleVersion (send the distribution or dry run payload to Distribution)
- curl $distributionUrl/api/v1/release_bundle/$releaseBundleName/$releaseBundleVersion/distribution/$trackerId (if not a dry run, using the tracker ID returned by Distribution, check if the distribution is complete)
- write_output (update the output ReleaseBundle resource)