From 497385818b42f298c777ce3fbeb3e2d55a2bdc64 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 19 Nov 2018 15:38:09 -0800 Subject: Check for instant heap production credentials in pre-publish step --- packages/monorepo-scripts/src/prepublish_checks.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'packages/monorepo-scripts/src/prepublish_checks.ts') diff --git a/packages/monorepo-scripts/src/prepublish_checks.ts b/packages/monorepo-scripts/src/prepublish_checks.ts index 5f603ebc7..fc550cf3a 100644 --- a/packages/monorepo-scripts/src/prepublish_checks.ts +++ b/packages/monorepo-scripts/src/prepublish_checks.ts @@ -17,6 +17,7 @@ async function prepublishChecksAsync(): Promise { await checkChangelogFormatAsync(updatedPublicPackages); await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages); await checkPublishRequiredSetupAsync(); + checkRequiredEnvVariables(); } async function checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages: Package[]): Promise { @@ -183,6 +184,16 @@ async function checkPublishRequiredSetupAsync(): Promise { } } +const checkRequiredEnvVariables = () => { + utils.log('Checking required environment variables...'); + const requiredEnvVars = ['INSTANT_HEAP_ANALYTICS_ID_PRODUCTION']; + requiredEnvVars.forEach(requiredEnvVarName => { + if (_.isUndefined(process.env[requiredEnvVarName])) { + throw new Error(`Must have ${requiredEnvVarName} set`); + } + }); +}; + prepublishChecksAsync().catch(err => { utils.log(err.message); process.exit(1); -- cgit