Add site-specific environment variables in local builds
See original GitHub issueThis issue is part of the bigger issue at #667
Site-specific environment variables (git, build, etc.) are missing in local builds (Netlify CLI and programmatically):
BRANCH
BUILD_ID
CACHED_COMMIT_REF
COMMIT_REF
CONTEXT
DEPLOY_ID
DEPLOY_PRIME_URL
DEPLOY_URL
HEAD
NETLIFY_IMAGES_CDN_DOMAIN
PULL_REQUEST
REPOSITORY_URL
REVIEW_ID
URL
My first question is whether the list above is correct?
My second question is for @netlify/backend: how to retrieve the information above? I know the getSite
API endpoint can be used, but does it include all that information? Can someone pinpoints which property is used for each environment variable? Are some of the environment variables using some conditional logic to find out their value?
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
How to: Use Environment Variables in a Build - MSBuild
Learn how to access environment variables in MSBuild project files, and use environment variables to set build options without modifying the ...
Read more >Build environment variables | Netlify Docs
Identify environment variables available in the build environment, set your own environment variables, and use environment variables during builds.
Read more >Environment Variables: What They Are and How To Use Them
Environment variables add dynamicity to your static code base; you can switch between internal/external resources based on the value of the ...
Read more >Adding Custom Environment Variables | Create React App
Environment variables are embedded into the build, meaning anyone can view them by inspecting your app's files. The environment variables are ...
Read more >What Are Environment Variables and How Can I Use Them ...
If you'd ever like to change that variable or add more, you can navigate to the Environment section of the Build & deploy...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We don’t need
NETLIFY_IMAGES_CDN_DOMAIN
URL
is important. (REPOSITORY_URL
too but less so)CLI should be able to pass in this value
Why’s that? Isn’t this for running build in local CLI (ie, user’s machine)? If so, it should have a user token already.