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

Simple way to override env vars from command line #42

Merged
merged 1 commit into from
Apr 20, 2024
Merged

Conversation

mdales
Copy link
Collaborator

@mdales mdales commented Apr 20, 2024

I just needed this so I could commit the postgis sharkdown demo file I have to the AoH repo. Like docker you can specify multiple -e KEY=VALUE env vars, but they only override ones that are in the sharkdown, they don't add new things (on the grounds we want all state to be explicit in the sharkdown file. The output sharkdown file has the substituted values in it.

I thought of doing this in the AST, but currently we only evaluate shell built-in equivalent commands at execution time, so in the end I went back on that change and just evaluate it at execution time. I'm not wedded to this, it was just the easiest way to get something in. Similarly this could come from a .env file rather than flags or such, but I just needed something of this form fast, so went with args for now.

@mdales mdales merged commit 5eb0e16 into main Apr 20, 2024
2 checks passed
@mdales mdales deleted the mwd-env-override branch April 20, 2024 13:33
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 this pull request may close these issues.

1 participant