feat(*_image): allow setting env vars - #2031
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
|
Change looks good. Could you add a test and sign the CLA? Thanks! |
|
Finished the PR and added tests.
I need to fiddle with some stuff on my side for the CLA: I have a weird email setup. |
Introduce an `env` parameter in every `*_image` rule, which is a dict whose keys and values will become environment variables in the resulting Docker image. Apply consistent formatting to every rule's docstring (args in the docstring are now listed in the same order as in the method declaration) as well as the container structure tests (`metadataTest` keys are now sorted alphabetically).
|
@gravypod let me know when you can take a look at this. |
|
Bump? |
|
sorry, this repo is kinda dead right now, see #2038 |
linzhp
left a comment
There was a problem hiding this comment.
LGTM except there is a debug statement that we may want to remove
| """Appends the app layer with all remaining runfiles.""" | ||
|
|
||
| for k in ctx.attr.env: | ||
| print("jar_app_layer", k, ctx.attr.env[k]) |
There was a problem hiding this comment.
oops! yes indeed, removed
* feat(*_image): allow setting env vars Introduce an `env` parameter in every `*_image` rule, which is a dict whose keys and values will become environment variables in the resulting Docker image. Apply consistent formatting to every rule's docstring (args in the docstring are now listed in the same order as in the method declaration) as well as the container structure tests (`metadataTest` keys are now sorted alphabetically).
Introduce an
envparameter in every*_imagerule, which is a dictwhose keys and values will become environment variables in the resulting
Docker image.
Apply consistent formatting to every rule's docstring (args in the
docstring are now listed in the same order as in the method declaration)
as well as the container structure tests (
metadataTestkeys are nowsorted alphabetically).
Aside: the docstring formatting seems weird to me, but I'm sticking with the more common one in the repo.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
It is not possible to wire environment variables through to a
*_imageinstance; they are forwarded to theenvof the underlying*_binary(usually).What is the new behavior?
It is now possible to wire environment variables through to a
*_image.Does this PR introduce a breaking change?
Other information