Closed tnh closed 6 years ago
Hmm, it's YAML, so you could use anchors and references:
env:
AWS_DEFAULT_REGION: ap-southeast-2
ENVIRONMENT: drprod
ACCOUNT: prod
steps:
- trigger: something-infrastructure
label: ':tractor: something'
build:
message: ${BUILDKITE_MESSAGE}
commit: HEAD
branch: master
env: &TRIGGER_ENV
ENVIRONMENT: drprod
ACCOUNT: prod
- wait
- trigger: another-thing-infrastructure
label: ':minibus: Deploy another thing ervices'
build:
message: ${BUILDKITE_MESSAGE}
commit: HEAD
branch: master
env: *TRIGGER_ENV
Finding a YAML reference is hard, but anchors and references are covered in this tutorial:
https://rhnh.net/2011/01/31/yaml-tutorial/
And there is environment variable interpolation in buildkite-agent v3 so you don't have to repeat the values, either:
env:
AWS_DEFAULT_REGION: ap-southeast-2
ENVIRONMENT: drprod
ACCOUNT: prod
steps:
- trigger: something-infrastructure
label: ':tractor: something'
build:
message: ${BUILDKITE_MESSAGE}
commit: HEAD
branch: master
env: &TRIGGER_ENV
ENVIRONMENT: "$ENVIRONMENT"
ACCOUNT: "$ACCOUNT"
- wait
- trigger: another-thing-infrastructure
label: ':minibus: Deploy another thing ervices'
build:
message: ${BUILDKITE_MESSAGE}
commit: HEAD
branch: master
env: *TRIGGER_ENV
I'm going to close this one out, let us know if the yaml references don't solve your problem.
Currently, we have a pipeline like:
what I dont like is
env
for each of the steps that is the sameI tried to do something like this but it doesnt work:
I'm wondering if it would be possible to either
ENVIRONMENT: ${ENVIRONMENT}