buildkite / buildkite/docs

Using "standard" env variables in the "Pipeline" env variable section

Open
#608 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
59
Forks
313
PR merge metrics
No merged PRs in 30d

Description

We want to use `$BUILDKITE_BUILD_ID` in one of the global env variables.

Example:
```sh
my_unique_temp_directory=/tmp/$BUILDKITE_BUILD_ID
cache_directory=$my_unique_temp_directory/cache
```

Right now reading this https://buildkite.com/docs/pipelines/environment-variables#environment-variable-precedence - it seems like it's impossible as the standard env variables are evaluated last.

This makes me re-define env variables at the beginning of every step that needs to use those locations.

Is there any way to work around it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.