Values are available for calculating expressions:
triggers:
post_commit:
args:
whathappened: 'This process was started by a '+event.name+' from '+event.repo.name
and substituting into scripts:
jobs:
main:
steps:
-
bash: |
echo This process was started by a {event.name} from {event.repo.name}
Different values will be available at different times in a process's lifecycle. For example, the event's value are available throughout, but details specific to the running process will only be available once that process has been started.
A job is has a number of fixed variables:
user.passwordrole.key and role.secretapi.url and api.hostblob.url and blob.hostscriptvar{var}/some/location can be used as var.some.location in expressions (the file's contents is the str's value).jobjob.prepare.something is the contents of file {job}/prepare/something,
which is the something result from the earlier job prepare. If a job's result is a directory then all of that directory's contents will be available.secret.<yoursecret>secret.<yoursecret>. Secrets are settings which are hidden. Your secrets can be set in your, or your repo's Settings. If a secret
is used, then that secret's value is redacted from your process's output.const.<yourconst>const.<yourconstant>. Constants can be set in your, or your repo's Settings.setting.<this><this>. This allows access to any setting, eg setting.repo.home found in Settings->Places.
secrets (setting.secret.<yoursecret>) and consts (setting.const.<yourconst>), as they're settings can also be
accessed using setting.There are also the process's run parameters:
process.*user.*repo.*event.*<yourarg>As noted above, the {var} directory is where variables can be stored.
echo Happy > {var}/outcome
These can be used in expressions:
jobs:
compile:
steps:
-
bash: echo The earlier result is {var.result}
-
condition: var.outcome == 'Happy'
And as results from the job:
jobs:
compile:
results:
happiness: outcome
Which can be used in later jobs:
jobs:
link:
after:
- compile
steps:
-
condition: job.compile.happiness == 'Happy'
Some values have multiple parts, shown by a .*, eg .user.*.
.user.username.user.api_id (optional)u-0123456789abcdef. This is missing when the user is an ex-user - a user which has been deleted after their checkins..user.urn (optional)urn/home/user/joebloggs. This is missing when the user is an ex-user - a user which has been deleted after their checkins.User values don't have this, but all other resources, such as repos, seals etc do.
.resource.owning_user.*users, as this is the user itself, .owning_user is not present..repo.primary.*.repo.seal.*.reporepository.rootdirectory.*.seal.kind'core'..rootdirectory.instance.*This resource has no additional fields.