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

Add support for dotenv files #104

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add support for dotenv files #104

wants to merge 2 commits into from

Conversation

rliebz
Copy link
Owner

@rliebz rliebz commented Apr 9, 2024

While I'm not sure there is a formal dotenv specification, I've used a library that's meant to be compatible with other language libraries, which should make things pretty familiar and compatible.

I've also attempted to model the semantics used by Docker Compose for file configuration, although 100% compatibility is probably not a guarantee this project will ever make.

Closes #98
Supercedes #99

While I'm not sure there is a formal dotenv specification, I've used a
library that's meant to be compatible with other language libraries,
which should make things pretty familiar and compatible.

I've also attempted to model the semantics used by Docker Compose for
file configuration, although 100% compatibility is probably not a
guarantee this project will ever make.

This is currently pending docs and release notes.
@rliebz
Copy link
Owner Author

rliebz commented Apr 9, 2024

@elyoni @smyrman—Here's my first pass at environment file support. Let me know if you have any thoughts here, or if there's anything this doesn't solve for that you think belongs in the first iteration.

One feature that was mentioned that I would probably punt on for now is specifying environment files anywhere other than the root of the configuration file. One of the weird things about sub-tasks and environment variables is that once an env var is set, there aren't super direct/obvious semantics for if that scope ends, or how that would interact with sub-tasks. Which is why run.set-environment very explicitly includes the word "set" and calls out that the change will persist until the program exits. That doesn't mean task-level env files can't ever happen, though, and I don't think this PR does anything that would make it harder down the line if a good design becomes obvious at any point.

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.

Load(source) environment variables from a file as configuration file.
1 participant