Skip to content
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

Make @netlify/config return site environment variables in local builds #2036

Closed
ehmicky opened this issue Nov 3, 2020 · 1 comment · Fixed by #2040
Closed

Make @netlify/config return site environment variables in local builds #2036

ehmicky opened this issue Nov 3, 2020 · 1 comment · Fixed by #2040
Assignees
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@ehmicky
Copy link
Contributor

ehmicky commented Nov 3, 2020

Site environment variables come from different sources: the site, the team, and addons.

Those environment variables are used by several parts of the build: the build command and plugins, but those are also used as the default value of @netlify/build options and @netlify/config options. Those are also used by CLI commands.

At the moment, @netlify/config does not compute/merge/return environment variables. @netlify/build does take build.environment from netlify.toml into account, but not site/team/addons ones.

@netlify/config should compute/merge environment variables from the site, team and addons, then return it as an env object. This should not happen if mode is buildbot. This env object should then be used by:

  • the Netlify CLI, replacing the current logic
  • @netlify/build. We should make sure it is currently merged in the current logic. For example, it should not be possible to override readonly environment variables like CONTEXT (see existing logic).

In order to compute those, some additional API calls will need to be performed by @netlify/config, in addition to getSite which is already currently performed in local builds.

@erezrokah

@ehmicky ehmicky added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Nov 3, 2020
@ehmicky ehmicky self-assigned this Nov 3, 2020
@ehmicky
Copy link
Contributor Author

ehmicky commented Nov 4, 2020

Done at #2040.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant