April 25, 2023, 3:39pm
I though that top-level
env created environment variables which affected every single step in the pipeline. Example:
- label: step1
command: echo $MYVAR
Comes up empty.
What is the recommended method of doing this? thanks
Thanks for reaching out!
I tried this on my end it works fine.
- label: "step1"
command: "echo $MYVAR"
Setting the env variable before steps makes it global and available to all steps. You can confirm this by checking the Environment tab it should have
MYVAR="SomeValue" as a variable set.
Let me know if this helps!
April 25, 2023, 3:55pm
Is your buildkite running a different version than mine? (I don’t even know if there’s such a thing)
I have set that in 2 places: the pipeline yml and the pipeline “pre” steps which load the actual yml
Neither of them kick in
April 25, 2023, 3:58pm
I went back to hardcoded env vars for every step. That works regardless. But it would be nice to find out why the other way does not work
@js-cb I’m using buildkite-agent version 3.42.0 . Can you check which version you are running might be an older version, use " buildkite-agent --v " . Incase its an older agent you can get a newer one , under the respective agent installer
The Buildkite agent is a small, reliable and cross-platform build runner that makes it easy to run automated builds on your own infrastructure. Its main responsibilities are polling buildkite.com for work, running build jobs, reporting back the...
I can also take a closer look at the build for you, please send the build link to
@js-cb that’s strange. Please send an email with a link to the build to email@example.com , I’m curious to see, what’s causing this as well