Batch contexts
This page describes contexts the Batch workflow can use in expressions for calculating YAML attribute values.
Batch Contexts
flow
project
params
env
tags
volumes
images
strategy
matrix
needs
git
flow
context
flow
contextThe flow
context contains information about the workflow: its ID, title, etc.
flow.flow_id
str
flow.project_id
str
flow.workspace
LocalPath
A path to the workspace (the root folder of the flow).
flow.title
str
flow.username
str
Name of user who executed the workflow run.
project
context
project
contextThe project
context contains information about the project: its ID, owner, etc.
project.id
str
project.owner
str
project.project_name
str
params
context
params
contextParameter described in the params
attribute .
params.<param-name>
str
The value of a specific parameter.
env
context
env
contextThe env
context contains environment variables that have been set in the workflow defaults. For more information about setting environment variables in your workflow, see "Batch workflow syntax."
The env
context syntax allows you to use the value of an environment variable in your workflow file. If you want to use the value of an environment variable inside a job, use your operating system's standard method for reading environment variables.
env.<env-name>
str
The value of a specific environment variable.
tags
context
tags
contextA set of job tags.
Tags available in this context are combined from system tags (project:<project-id>
, flow:<flow-id>
, task:<task-id>
), and flow default tags (see defaults.tags
attribute).
tags
set[str]
This context changes for each job. You can access this context from any job.
volumes
context
volumes
contextContains information about volumes defined in the volumes
section of a batch workflow.
volumes.<volume-id>.id
str
volumes.<volume-id>.remote
URL
volumes.<volume-id>.mount
RemotePath
The path inside a job by which the volume should be mounted.
volumes.<volume-id>.read_only
bool
True
if the volume is mounted in read-only mode, False
otherwise.
volumes.<volume-id>.local
None
In batch workflows, this property is always None
.
volumes.<volume-id>.full_local_path
LocalPath
or None
Full version of local
property.
volumes.<volume-id>.ref
str
The value is assembled from the remote
, mount
, and read_only
properties.
volumes.<volume-id>.ref_ro
str
Like ref
but read-only mode is enforced.
volumes.<volume-id>.ref_rw
str
Like ref
but read-write mode is enforced.
images
context
images
contextContains information about images defined in the images
section of a batch workflow.
images.<image-id>.id
str
images.<image-id>.ref
str
images.<image-id>.context
None
In batch workflows, this property is always None
.
images.<image-id>.full_context_path
None
In batch workflows, this property is always None
.
images.<image-id>.dockerfile
None
In batch workflows, this property is always None
.
images.<image-id>.full_dockerfile_path
None
In batch workflows, this property is always None
.
images.<image-id>.build_args
list[str]
In batch workflows, this property is always []
(empty list).
images.<image-id>.env
dict[str, str]
In batch workflows, this property is always {}
(empty dict).
images.<image-id>.volumes
list[str]
In batch workflows, this property is always []
(empty list).
strategy
context
strategy
contextContains information about some strategies of execution set in the flow defaults.
strategy.fail_fast
bool
strategy.max_parallel
int
matrix
context
matrix
contextContains parameters from a combination generated by the tasks.strategy.matrix
attribute.
matrix.<param-name>
bool
or int
or float
or str
or None
The matrix parameter value for the current combination.
needs
context
needs
contextContains outputs generated by tasks that were specified in the tasks.needs
attribute. Refer to the set-output
command reference to learn how to generate outputs.
needs.<task-id>.result
str
State of the completed task <task-id>
. Can be one of the following: "succedded"
, "failed"
, "cancelled"
, "skipped"
.
needs.<task-id>.outputs.<output-name>
str
The value of the <output-name>
output produced by the <task-id>
task.
git
context
git
contextThe git
context contains a mapping of your flow's workspace to a git repository.
This context can only be used if the flow's workspace is inside some git repository.
git.sha
str
SHA of the current commit.
git.branch
str
Name of the current branch.
git.tags
list[str]
List of tags that point to the current commit.
Last updated