-
Notifications
You must be signed in to change notification settings - Fork 248
[devbox.json] support env_from dotenv files #2174
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
Conversation
Do
|
@Lagoja not common but |
I think I'm ok to add it later, current functionality is probably good for now |
return nil, fmt.Errorf("env file does not have a .env extension") | ||
} | ||
|
||
file, err := os.Open(c.EnvFrom) |
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.
This will fail if devbox is call from any other directory that is not where the devbox.json is. I don't think it makes sense to make this relative from the working directory, it should be relative from the config file directory.
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.
I agree with this, my project failed due to it.
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.
@varunpalekar thanks for reminding on the issue. I made a PR to fix this, once merged it will be available in the next version of devbox.
There are two scenarios that need to be addressed:
It would be ideal to have a way to override |
Summary
NOTE: Docs update PR will follow.
As per request from users, I added support for
env_from
field being able to take a path to*.env
file and have those env variables available in devbox shell and run.If a duplicate env variable is specified in both
.env
and in the"env"
section of devbox.json, the env section from devbox.json takes priority and overwrites. This I believe is the correct behavior but I'm open to discussion.How was it tested?
see test file at
testscripts/run/envfrom.test.txt