Closed carldjohnston closed 5 years ago
I understand that it would be hard to change this in a minor release
Yup, that has largely been our concern. General consensus is that it's confusing enough that we'll figure out a way to make the change.
Apologies, and thanks for the well articulated issue.
@carldjohnston 👋 sorry for the super long delay on following up on this! Just wanted to give you a heads up that our new YAML defined steps in the Buildkite UI gear fixes the precedence: https://forum.buildkite.community/t/defining-pipeline-build-steps-with-yaml/79
It now works as you expected it did :)
Hi Buildkiters,
Just hit some unintuitive behaviour with environment variable precedence in a pipeline.yml file.
I was expecting that I could define default environment variables in the
env:
block at the root of the pipeline.yml fine, and override these within each step.Your docs are correct, and define the actual behaviour, whereby you define a top level
env:
block, and this is applied to the entire pipeline, ignoring any step specificenv:
definitions; this feels opposite to what should happen.I understand that it would be hard to change this in a minor release, but it might make sense to be able to define a
default_env:
at the root of the pipeline.yml file, and then be able to override these settings in each step, or fix the behaviour and introduce a breaking change.Cheers,
Carl