Use Stateful Resources

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide

Resources are stateful entities and persist across pipelines, enabling passing of information between pipelines. This is especially useful when creating a pipeline of pipelines.

Steps can store any key-value pair data in a resource using the write_outpututility function. These values can then be referenced as environment variables by any subsequent cuting step that uses that resource as an input. Therefore, a step can pass information to another step in the run of the pipeline.

The environment variable for the stored value is of the form res_<resource name>_<key name>.

Example

The following example creates three properties in the resource myImage.

Using write_output

write_output myImage sport="baseball" equipment="bat" field="diamond"

When the resource is specified in a step's inputResources, these properties can be accessed as the following environment variables:

Environment Variables

$ printenv res_myImage_sport
baseball
$ printenv res_myImage_equipment
bat
$ printenv res_myImage_field
diamond

For more information, see Creating Stateful Pipelines.