-
Notifications
You must be signed in to change notification settings - Fork 357
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
Use environment variables from @netlify/config #1722
Conversation
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.
Thanks @eduardoboucas. Looks good and I love all the code removal.
It's great the CLI doesn't have to resolve those env variables.
Added a few comments/questions.
Please let me know what you think
@erezrokah I addressed your comments in 320d074, except for #1722 (comment) (removing this is causing the tests to fail, I'm investigating ⏳ ) Note that in 320d074#diff-98719cf70cb4c9ae11108e4f1dc3b629caf2e0f429a9ad4dee054596f8f69950L24-R22 I removed the filtering for As a result of this, I had to remove the corresponding test. I'll try to add a similar test in a more appropriate place, to assert that |
Great catch! Removing the filtering logic makes sense. |
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 is looking great, thanks @eduardoboucas!
Everything is looking neat ✌️
The CI tests are failing, but I'm not quite sure this is related to this PR considering different tests are failing, and not for every OS and Node.js version... @erezrokah What do you think?
Yes, everything looks good. Looks the deploy command tests are especially flaky, Seems unrelated. I'm working to improve those too. |
Contrary to our internal discussion, I ended up including the addition of the @erezrokah @ehmicky if you're okay with that, and once the tests finish running, what's our plan for releasing? Do we release Thanks! 🙌🏻 |
I'm good with it. The release process you described is 💯 |
@eduardoboucas and I will pair to release this and the related Netlify Build PR tomorrow. |
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.
@eduardoboucas This should be ready for merge, after @netlify/build
and @netlify/config
are updated to the latest versions in package.json
.
7d446af
to
99318fa
Compare
- Summary
This PR is the CLI counterpart of netlify/build#2040. It introduces the updated environment variables object coming from
@netlify/build
to various commands.Copying across this list created by @ehmicky in the build PR. I'll use it to track the progress on the various commands.
netlify build
:env
option to@netlify/build
anymoregetBuildEnv()
can be removed.netlify env:list
andnetlify env:get
:env
return value from@netlify/config
instead ofconfig.build.environment
.We might want to select only specific environment variables categories, and merge them.
netlify dev
,netlify dev:exec
,netlify functions:create
:env
return value from@netlify/config
. Note: this will also add support tobuild.environment
.dev.environment
property innetlify.toml
should be merged to them:{ ...env.all, ...dev.environment }
.getSiteInformation()
anymore, except for theaddonsUrl
anddotenv
logicaddEnvVariables()
to dissociate between netlify.toml and UI site environment variables--offline
CLI flag to@netlify/config
.netlify dev:exec
andnetlify functions:create
might not have this flag yet, butnetlify dev
does.- Test plan
Added new tests that assert the capture of environment variables from
[build.environment]
. Rest of the test suite unchanged.- Description for the changelog
Mimic the environment variables used in production
- A picture of a cute animal (not mandatory but encouraged)