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

jsonnet_library to support ext_code param #89

Open
borg286 opened this issue Dec 29, 2018 · 1 comment
Open

jsonnet_library to support ext_code param #89

borg286 opened this issue Dec 29, 2018 · 1 comment

Comments

@borg286
Copy link

borg286 commented Dec 29, 2018

I have a use case where I want to take values fetched from bazel BUILD files and pipe them into my jsonnet_library targets. More notably I want to pipe in the BUILD_USER into a value in my library, then use that library elsewhere. This is similar to the "data" param common in other bazel rules, but this one routes variables in BUILD files rather than the contents of files in.

@borg286
Copy link
Author

borg286 commented Dec 29, 2018

I was able to work around it by having a jsonnet_to_json target where I used ext_code to pass the variable in. The jsonnet simply pulled the variable in via std.extVar and output it. I then used the "data" param on jsonnet_library to consume this json and pull out the values I wanted. Still it would be nice to avoid this hack.

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

No branches or pull requests

1 participant