Pipeline level env vars


With the previous method of defining pipelines it was possible to define env vars that applied to every step in the downloaded pipeline, however the new syntax only allows step level env which is not automatically passed to each downloaded step.

In the previous thread it was suggested that this should work:

  SOMETHING: "test"

  - command: "buildkite-agent pipeline upload"

However this didn’t seem to work for me.

The only work around I’ve got at the moment is to process the variables in the downloaded pipeline like this:

- label: ':rocket: Deploy'
  command: deploy.sh
      image: google/cloud-sdk


@jam13 ah, you’re totally right - that’s a bug! :bug: I was able to reproduce this locally and I’ve got a fix ready to roll out as soon as it’s gone through some internal review tomorrow. Will reply here once it’s shipped to production.

Sorry for my confusion earlier, and thanks for taking the time to get back to me about it!


Will pipeline level env also be supported in the pipeline.yml from source? That might be handy if so.


You can do this now in the pipeline.yml file:

  BLAH: "blah"

  - command: "echo $BLAH"

…if that’s what you mean? In that example, BLAH will be copied to all steps that are defined in the current file.


Yes that’s what I mean, thanks.


@jam13 :wave: sorry for the delay with this one, but I just wanted to let you know that I pushed a fix for this - so…

  SOMETHING: "test"

  - command: "buildkite-agent pipeline upload"

…will now work as you’d expect! Thanks again for submitting the issue!


@jam13 I just wanted to check back and see if everything’s with your pipeline now?


Will modify the pipeline and try a build.


Works as expected now. Thanks for the quick response.