buildkite / feedback

Got feedback? Please let us know!
https://buildkite.com
25 stars 24 forks source link

Env var interpolation in trigger step doesn't work #260

Closed ankurd1 closed 7 years ago

ankurd1 commented 7 years ago

As per the docs, I have a trigger step in my pipeline.yml that looks like this:

- trigger: 'deploy'
    async: true
    branches: 'master'
    label: 'Schedule Deploy'
    build:
      branch: "$BUILDKITE_BRANCH"
      commit: "$BUILDKITE_COMMIT"

This leads to a "deploy" build with branch=$BUILDKITE_BRANCH. Basically the string ($BUILDKITE_BRANCH) and not the actual branch name. I also tried ${BUILDKITE_BRANCH} but same issue there.

toolmantim commented 7 years ago

Hey @legalosLOTR, sorry you've had troubles with this. It's only supported in Buildkite Agent v2, but we failed to mention that in the example. Sorry!

We’ve just updated the docs to include more information about this: https://buildkite.com/docs/agent/cli-pipeline#environment-variable-substitution (whole new section, including notes for a workaround for getting it to work with Buildkite Agent v2) https://buildkite.com/docs/pipelines/trigger-step (note on the bottom)

I recommend upgrading to agent v3 if you can, but there is that workaround if you need.

Let me know if that clears things up!

ankurd1 commented 7 years ago

Ahh thanks @toolmantim! Is agent v3 stable enough to use? Also, is there a migration guide or would it "just work"?

toolmantim commented 7 years ago

It's close to stable, and is being used in prod in quite a few places. There isn't yet a migration guide sorry. The biggest change is the docker-compose support has been removed in favor of https://github.com/buildkite-plugins/docker-compose-buildkite-plugin