[all] Check for VERCEL_ environment variables with getPlatformEnv() (#4274)

Added the following env vars, most are undocumented but its good to be consistent:

- `VERCEL_REGION`
- `VERCEL_DEBUG`
- `VERCEL_BUILDER_DEBUG`
- `VERCEL_TOKEN`
- `__VERCEL_SKIP_DEV_CMD`

I also updated the error code prefixes to remove `NOW_`.
There `code` isn't used anywhere, this is just to make it unique and a little shorter.
This commit is contained in:
Steven
2020-05-06 18:13:12 -04:00
committed by GitHub
parent 639a9b03d2
commit ba25004ea8
25 changed files with 85 additions and 77 deletions

View File

@@ -54,16 +54,16 @@ async function testDeployment(
}
// we use json5 to allow comments for probes
const nowJson = json5.parse(bodies['now.json']);
const nowJson = json5.parse(bodies['vercel.json'] || bodies['now.json']);
if (process.env.NOW_BUILDER_DEBUG) {
if (process.env.VERCEL_BUILDER_DEBUG) {
if (!nowJson.build) {
nowJson.build = {};
}
if (!nowJson.build.env) {
nowJson.build.env = {};
}
nowJson.build.env.NOW_BUILDER_DEBUG = process.env.NOW_BUILDER_DEBUG;
nowJson.build.env.VERCEL_BUILDER_DEBUG = process.env.VERCEL_BUILDER_DEBUG;
}
for (const build of nowJson.builds || []) {