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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse environment variables on build configuration #1667
Conversation
@maturano Is this for loading config values from environment variables for use in something like Docker? |
I was not thinking specifically in Docker, but I think could be also a use case. I used environment variables on the On #1590 I documented some cases and their result. I'll put the result of this PR hoping makes clear why should be included. |
@maturano good thinking 馃槈 |
@derrickmehaffy I didn't see any new comments on the original issue. I updated the description of this PR hopping having better visibility. |
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.
Excellent work! 馃憤
Move existing code to a shared library and invoke it on the build process to parse environment variables on configuration files. Looking for a consistent behavior. close #1590
Glad to help :) I just made a rebase with |
My PR is a: 馃悰 Bug fix
Main update on the: Framework
Currently the use of environment variables in the configuration files is allowed, however the values are not replaced building the administration panel. You can clearly see the error if you try to use an environment variable as the value of the
host
parameter in theserver.json
file:As can see, the value was used as an ordinary string; they were not replaced by the value of the environment variable.
This PR moves the code that makes that interpretation to
strapi-utils
trying to make it a shared functionality. In addition to been invoked originally in the same place, with this changes also it's called bywebpack
, getting a consistent result in the build.You can see here the result of this change:
Notes:
strapi-utils
the correct place? 馃close #1590