state resource is a special resource used to store data that can be shared between jobs. Shippable DevOps Assembly lines do not allow workflows that have circular dependencies. There are certain situations where data needs to be passed back and forth between jobs. For example, Terraform tasks create a state that needs to be persisted each time the job runs.
state resource was specifically designed to achieve circular dependencies in DevOps Assembly Lines.
You can create a
state resource by adding it to
resources: - name: <string> type: state
name-- should be an easy to remember text string
type-- is set to
Used in Jobs
This resource is used as an
OUT of any of job.
Default Environment Variables
state is used as an
OUT for a job that can execute user defined scripts, a set of environment variables are configured by the platform that may be useful to set the context before user defined scripts execute as part of the job. These variables are available when this resource is used.
<NAME> is the the friendly name of the resource.
||The name of the resource.|
||The ID of the resource.|
||The type of the resource. In this case
||The operation of the resource; either
||The directory containing files for the resource.|
||SourceName defined in the pointer.|
||The ID of the version of the resource being used.|
||The number of the version of the resource being used.|
Shippable Utility Functions
To make it easy to use these environment variables, the platform provides a command line utility that can be used to work with these values.
How to use these utility functions is documented here.