-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 env file #665
Support env file #665
Conversation
I would love to see this merged into fig. I know its only been a few days, but any eta on when that might happen? Environment management is a bit of a pain-point for me right now |
I'd also obviously love to see this merged. Feedback for improvements is welcome and I'll get them done as fast as possible to make this merge-ready. |
+1 |
def _get_environment(self): | ||
env = {} | ||
|
||
if 'env_file' in self.options: |
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 think using self.options
here would mean that override_options
is missed. I guess this doesn't technically break anything right now, but I don't think the way the -e
param is implemented for fig run
is correct, and this would make it harder to fix (it should be using override_options instead of setting service.options).
We may also want to add a command line arg for --env-file
at some point.
Could you make this take a param of options instead? This would also have a nice side benefit that self
would be unused, and the method could be moved off the class to just a module level helper.
Thanks for the PR! I think this is looking good, I just left a few suggestions. A git squash on some of the commits would be good too, once it's all ready. |
I'll address your suggestions tomorrow and then request another round of review :) |
I think I've now resolved all of your suggestions. I'll leave the commits separate for one more round of review, then squash for merge later. |
👍 this would be great |
+1 |
LGTM (with a squash) |
🎉 |
3c92be9
to
9a96ea2
Compare
Rebased as requested. Merge-ready. |
hmm, looks like the latest test run hit some errors, not sure if that was a problem on werkers end or what happened. I've put this into the milestone for the next release. |
894dec9
to
8ffdbbe
Compare
Now this is ready :) |
@dnephin Could we get this merged? It's being discussed as a failing of Fig over at moby/moby#9459 (comment). |
@@ -120,6 +120,21 @@ environment: | |||
- SESSION_SECRET | |||
``` | |||
|
|||
### env_file | |||
|
|||
Add environment variables from a file. You must use an array. |
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 wonder if we could support the normal use case where it isn't an array? Should just be an isinstance(..., list)
right?
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.
Done :)
Looks awesome, thanks @benlangfeld! Needs a rebase though. |
068b617
to
2fd5df9
Compare
Rebased and ready for merge :) |
Signed-off-by: Ben Langfeld <ben@langfeld.me>
2fd5df9
to
98b6d7b
Compare
LGTM |
Thanks @benlangfeld! |
🎉 |
Looking at the code, it appears as if I've been using the |
Ha, didn't see that part of the earlier comment. I can give it a try when I free up, but it would be hacky at best and take me a while to get to testing since I've never written anything in python before. @benlangfeld if there's someone else with python experience that wants to take it on before all of that happens, I'd be grateful. |
I'm in precisely the same position as you @eudaimos. This is the first Python code I've ever written :) |
Any idea when this will be delivered? |
Looking forward to this a lot. Any chance of a minor release soon? |
I'd also be really happy for this. This is a showstopper. |
👍 Our team is waiting for this one as well. |
+1 we are waiting on this too! |
This feature is available in the latest docker-compose RC releases https://github.com/docker/fig/releases |
Support env file Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Replaces #481 and #479 addressing the issues raised in those tickets.