aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2019-01-11 23:50:41 +0800
committerFabio Berger <me@fabioberger.com>2019-01-11 23:50:41 +0800
commit55ce0d9d1782257968c825b936c44084dcc140aa (patch)
tree2c706a6ab010b870015966b582c18bc8b6ba2b78
parent895460aea329d8bb8a289297403be0a0c4b5a65b (diff)
downloaddexon-sol-tools-55ce0d9d1782257968c825b936c44084dcc140aa.tar
dexon-sol-tools-55ce0d9d1782257968c825b936c44084dcc140aa.tar.gz
dexon-sol-tools-55ce0d9d1782257968c825b936c44084dcc140aa.tar.bz2
dexon-sol-tools-55ce0d9d1782257968c825b936c44084dcc140aa.tar.lz
dexon-sol-tools-55ce0d9d1782257968c825b936c44084dcc140aa.tar.xz
dexon-sol-tools-55ce0d9d1782257968c825b936c44084dcc140aa.tar.zst
dexon-sol-tools-55ce0d9d1782257968c825b936c44084dcc140aa.zip
Add pre-publish check to ensure publisher is logged in to docker cmdline
-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> {