aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/prepublish_checks.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2019-01-14 22:24:00 +0800
committerFabio Berger <me@fabioberger.com>2019-01-14 22:24:00 +0800
commit84163517c600ff64e0d6ece4ecba40a8aeb52d73 (patch)
treea906b6f1d2d137a7175e54bb09da6796a7d4dfb6 /packages/monorepo-scripts/src/prepublish_checks.ts
parent96ff5eef644b8c4d3f8fc4ec53270991fb51f121 (diff)
downloaddexon-0x-contracts-84163517c600ff64e0d6ece4ecba40a8aeb52d73.tar
dexon-0x-contracts-84163517c600ff64e0d6ece4ecba40a8aeb52d73.tar.gz
dexon-0x-contracts-84163517c600ff64e0d6ece4ecba40a8aeb52d73.tar.bz2
dexon-0x-contracts-84163517c600ff64e0d6ece4ecba40a8aeb52d73.tar.lz
dexon-0x-contracts-84163517c600ff64e0d6ece4ecba40a8aeb52d73.tar.xz
dexon-0x-contracts-84163517c600ff64e0d6ece4ecba40a8aeb52d73.tar.zst
dexon-0x-contracts-84163517c600ff64e0d6ece4ecba40a8aeb52d73.zip
Add additional check to make sure user was added to our DockerHub org
Diffstat (limited to 'packages/monorepo-scripts/src/prepublish_checks.ts')
-rw-r--r--packages/monorepo-scripts/src/prepublish_checks.ts24
1 files changed, 9 insertions, 15 deletions
diff --git a/packages/monorepo-scripts/src/prepublish_checks.ts b/packages/monorepo-scripts/src/prepublish_checks.ts
index 75a8935c8..fdb2c5e57 100644
--- a/packages/monorepo-scripts/src/prepublish_checks.ts
+++ b/packages/monorepo-scripts/src/prepublish_checks.ts
@@ -6,31 +6,25 @@ import semverSort = require('semver-sort');
import { constants } from './constants';
import { Package } from './types';
import { changelogUtils } from './utils/changelog_utils';
+import { configs } from './utils/configs';
+import { dockerHubUtils } from './utils/docker_hub_utils';
import { npmUtils } from './utils/npm_utils';
import { utils } from './utils/utils';
async function prepublishChecksAsync(): Promise<void> {
const shouldIncludePrivate = false;
- const updatedPublicPackages = await utils.getPackagesToPublishAsync(shouldIncludePrivate);
+ // const updatedPublicPackages = await utils.getPackagesToPublishAsync(shouldIncludePrivate);
- await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicPackages);
- await checkChangelogFormatAsync(updatedPublicPackages);
- await checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages);
- await checkPublishRequiredSetupAsync();
+ // await checkCurrentVersionMatchesLatestPublishedNPMPackageAsync(updatedPublicPackages);
+ // 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. Full error: ${
- err.message
- }`,
- );
- }
+ await dockerHubUtils.checkUserAddedToOrganizationOrThrowAsync(configs.DOCKER_HUB_ORG);
+ await dockerHubUtils.loginUserToDockerCommandlineOrThrowAsync();
}
async function checkGitTagsForNextVersionAndDeleteIfExistAsync(updatedPublicPackages: Package[]): Promise<void> {