-
Notifications
You must be signed in to change notification settings - Fork 366
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
fix(build): pass team,site, addons env variables to build command #1519
Conversation
src/lib/build.js
Outdated
warn, | ||
error, | ||
}) | ||
const env = { ...teamEnv, ...addonsEnv, ...siteEnv, ...dotFilesEnv } |
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.
@ehmicky since @netlify/config
already evaluates some of these, should we move this logic to @netlify/config
?
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.
Yes.
I have filed netlify/build#2036 with additional information. However, this can be done in a follow-up PR.
Checking why this is failing on node 8 |
Looks like this is another issue with
For example https://github.com/oclif/errors/blob/2233a100fbb8822a15a74e97c5f1ebd32c876a99/package.json#L35. A breaking change was done in https://github.com/oclif/errors/pull/27/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R9, but was published as a minor version oclif/errors@v1.2.2...v1.3.0 Opened oclif/errors#97 |
04e46b5
to
f916175
Compare
@ehmicky this is ready for review |
src/lib/build.js
Outdated
const getBuildEnv = async ({ context }) => { | ||
const { warn, error, netlify } = context | ||
const { site, api } = netlify | ||
const { teamEnv, addonsEnv, siteEnv, dotFilesEnv } = await getSiteInformation({ |
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.
We should reach a conclusion in netlify/build#1514 before adding .env
support in local builds. Would it be ok to split this specific feature from this PR?
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 in 1556c56
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 good.
Just one comment about .env
files support.
- Summary
Fixes #1331
- Test plan
Tested manually with the flow in https://github.com/nimbella/netlify-plugin-nimbella
- Description for the changelog
Inject relevant env variables when running the build command.
- A picture of a cute animal (not mandatory but encouraged)