-
Notifications
You must be signed in to change notification settings - Fork 264
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 ./moodle-docker.env #232
Conversation
062bfa5
to
50f902c
Compare
Hi @skodak, According to docker-compose documentation, .env are also loaded in a prioritized way of loading variables. This is why I suggested add support for .env on #80. Natively it would be supported by Windows platforms. However, it is a big and final step towards supporting several Moodle versions locally. Super! Congrats! |
hi @jpahullo , docker .env loading is not applicable in moodle-docker-compose script because we need the environment variables BEFORE the real docker-compose is executed to create configuration for it. moodle-docker.env file contains environment settings for moodle-docker-compose script (and for docker too). With my patch you can still use .env, but the moodle-docker-compose script cannot use values from it. I think I am onto something with the Windows support, I might try to make it work this weekend unless somebody volunteers. |
Hi @skodak ! You're totally right! I missed this part when commenting. Thanks!!! |
hehe, I would not know if I did not try to create .env and failing badly... |
I should have Windows support for this issue later today |
argh, not there yet, I ned to find out how to check if %%1 env variable is set |
now it should be finally ready for review with full Windows support, please note the "setlocal" command which makes the env variables behave more like in bash, without it the SET would propagate into the next execution and break stuff |
(sorry for the delay, @skodak, will be looking to this ASAP!) |
any progress @stronk7 ? |
Any news from this? Thanks a lot for your work! |
See also #249 which uses shdotenv to get a better support for dotenv files. |
Hi, is there any reason we cannot make the env file to be a truly "dotenv" ( Also is the "define only if not set" fallback respected?
Note I'm also looking to #249, really both are similar (add to the environment some variables, if they are not defined), using 2 different approaches. I like here that it supports (not tested) Windows and that there aren't external dependencies. In the other side, surely the supported variables will be a little more limited, but I also think that it will be enough for what moodle-docker needs (simple 1-word contents). Ciao :-) |
+1 |
Hi @skodak , Then (taking a couple of pointers from #249):
Cheers, |
sorry @mattporritt , but the in any case I have decided to maintain my own fork because I need this for all my development, so I will not be submitting any more pull requests here |
See the README.md for more information how to use it.
My main objectives were:
NOTE: this feature is not supported in Windows because I do not know how to parse the env file there.