-
Notifications
You must be signed in to change notification settings - Fork 691
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except there is a debug statement that we may want to remove
java/image.bzl
Outdated
@@ -169,6 +169,9 @@ jar_dep_layer = rule( | |||
def _jar_app_layer_impl(ctx): | |||
"""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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug statements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
env
parameter in every*_image
rule, 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 (
metadataTest
keys 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
*_image
instance; they are forwarded to theenv
of 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