Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for propagating all environment variables #79

Closed
zsims opened this issue Oct 23, 2018 · 6 comments · Fixed by #80
Closed

Add option for propagating all environment variables #79

zsims opened this issue Oct 23, 2018 · 6 comments · Fixed by #80

Comments

@zsims
Copy link
Contributor

zsims commented Oct 23, 2018

Per the Elastic CI for AWS guidance (https://github.com/buildkite/elastic-ci-stack-for-aws#what-type-of-builds-does-this-support):

Each project should encapsulate it's dependencies via Docker and Docker Compose

This results in using this plugin for setting up build dependencies. It would be nice to add an option to propagate all environment variables to the container, e.g.

steps:
  - command: "echo \$BUILDKITE_COMMIT"
    plugins:
      - docker#v2.0.0:
         image: bash 

Rather than having to specify that BUILDKITE_COMMIT propagates to the container (with environment)

@lox
Copy link
Contributor

lox commented Oct 23, 2018

Agreed! Any suggestions on what the syntax for that would look like?

steps:
  - command: "echo \$BUILDKITE_COMMIT"
    plugins:
      - docker#v2.0.0:
         image: bash
         build-environment: true

@zsims
Copy link
Contributor Author

zsims commented Oct 23, 2018

I think something like propagate-env: true or include-all-env: true or automatic-environment: true avoiding something like build as that is a bit confusing re docker build

steps:
  - command: "echo \$BUILDKITE_COMMIT"
    plugins:
      - docker#v2.0.0:
         image: bash
         propagate-env: true

@toolmantim
Copy link
Contributor

toolmantim commented Oct 23, 2018

Just to be clear… we'd just want the job environment variables sent down from the web UI yeah (the ones in the environment tab)? Not necessarily any environment variables picked up from the Elastic CI Stack environment? (like secrets)

@zsims
Copy link
Contributor Author

zsims commented Oct 24, 2018

I would have thought all of them, e.g what you'd normally have in a naked step?

@lox
Copy link
Contributor

lox commented Oct 24, 2018

Yeah, I'd imagine that we'd load all of them via the envfile.

@zsims
Copy link
Contributor Author

zsims commented Oct 31, 2018

@toolmantim / @lox have you had any time to poke #80?

@lox lox closed this as completed in #80 Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants