aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/monorepo-scripts/src/prepublish_checks.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/monorepo-scripts/src/prepublish_checks.ts b/packages/monorepo-scripts/src/prepublish_checks.ts
index 82eaf5cf9..61ac76823 100644
--- a/packages/monorepo-scripts/src/prepublish_checks.ts
+++ b/packages/monorepo-scripts/src/prepublish_checks.ts
@@ -17,6 +17,18 @@ async function prepublishChecksAsync(): Promise<void> {
await checkChangelogFormatAsync(updatedPublicPackages);
await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages);
await checkPublishRequiredSetupAsync();
+ await checkDockerHubSetupAsync();
+}
+
+async function checkDockerHubSetupAsync(): Promise<void> {
+ try {
+ utils.log('Checking that the user is logged in to docker command...');
+ await execAsync(`echo "$DOCKER_PASS" | docker login -u $DOCKER_USERNAME --password-stdin`);
+ } catch (err) {
+ throw new Error(
+ 'Failed to log you into the `docker` commandline tool. Make sure you have environment variables `DOCKER_USERNAME` and `DOCKER_PASS` set.',
+ );
+ }
}
async function checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages: Package[]): Promise<void> {