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

Support variables #23

Open
arctic-hen7 opened this issue Jul 18, 2021 · 1 comment
Open

Support variables #23

arctic-hen7 opened this issue Jul 18, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@arctic-hen7
Copy link
Owner

Description
A new top-level HashMap [variables], which would allow the derivation of values that can be interpolated into commands. When preparing a command to be run, we'd compute their values (they'd be fully-fledged command cores themselves, their outputs become the values) and interpolate them. We could then store the values we've attained in a temporary HashMap that we pass around to each subcommand etc. so we don't compute any unnecessary values, but we also don't compute any values twice.

Reasoning
Make does this excellently, and Bonnie has reached the point where this feature is really a must. I see this as the third type of interpolation in addition to arguments and environment variables.

Are you willing to work on an implementation of this?
Yes.

@arctic-hen7 arctic-hen7 added enhancement New feature or request triage This issue needs to be examined by a maintainer labels Jul 18, 2021
@arctic-hen7 arctic-hen7 self-assigned this Jul 18, 2021
@arctic-hen7 arctic-hen7 removed the triage This issue needs to be examined by a maintainer label Jul 18, 2021
@bjesuiter
Copy link

bjesuiter commented Oct 28, 2021

Update:

I found the availability of the env_files = [ ".env" ] key. ^^
This is what I need, I hadn't seen that before.
But anyway, dynamic variables from commands sound very exciting and useful!

Original

This is great, it's exactly what I want for my current problem.

I have the following bonnie file:

version = "0.3.2"

[scripts]
    build = "docker build -t \"${TARGET_IMAGE}:latest\" ."
    tag   = "docker tag ${TARGET_IMAGE}:latest ${TARGET_IMAGE}:${MC_BASE_IMAGE_VERSION}"

The problem is, that I need to define these ENV Vars outside of the bonnie.toml and find a way to load them on every bonnie command.

This hashmap feature would solve that problem, since it would pass all HashMap variables into the environment of the bonnie commands!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants