@hubspot/cli 4.0.1-beta.5 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commands/sandbox/create.js +4 -2
- package/commands/sandbox/delete.js +11 -3
- package/lib/projects.js +18 -4
- package/package.json +4 -4
|
@@ -120,10 +120,10 @@ exports.handler = async options => {
|
|
|
120
120
|
succeedColor: 'white',
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
let namePrompt;
|
|
124
|
-
|
|
125
123
|
trackCommandUsage('sandbox-create', {}, accountId);
|
|
126
124
|
|
|
125
|
+
let namePrompt;
|
|
126
|
+
|
|
127
127
|
if (!name) {
|
|
128
128
|
namePrompt = await createSandboxPrompt();
|
|
129
129
|
}
|
|
@@ -151,6 +151,8 @@ exports.handler = async options => {
|
|
|
151
151
|
} catch (err) {
|
|
152
152
|
debugErrorAndContext(err);
|
|
153
153
|
|
|
154
|
+
trackCommandUsage('sandbox-create', { success: false }, accountId);
|
|
155
|
+
|
|
154
156
|
spinnies.fail('sandboxCreate', {
|
|
155
157
|
text: i18n(`${i18nKey}.loading.fail`, {
|
|
156
158
|
sandboxName,
|
|
@@ -16,7 +16,9 @@ const { deleteSandbox } = require('@hubspot/cli-lib/sandboxes');
|
|
|
16
16
|
const { i18n } = require('@hubspot/cli-lib/lib/lang');
|
|
17
17
|
const { getConfig, getEnv } = require('@hubspot/cli-lib');
|
|
18
18
|
const { deleteSandboxPrompt } = require('../../lib/prompts/sandboxesPrompt');
|
|
19
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
removeSandboxAccountFromConfig,
|
|
21
|
+
} = require('@hubspot/cli-lib/lib/config');
|
|
20
22
|
const {
|
|
21
23
|
selectAndSetAsDefaultAccountPrompt,
|
|
22
24
|
} = require('../../lib/prompts/accountsPrompt');
|
|
@@ -114,7 +116,9 @@ exports.handler = async options => {
|
|
|
114
116
|
);
|
|
115
117
|
logger.log('');
|
|
116
118
|
|
|
117
|
-
const promptDefaultAccount =
|
|
119
|
+
const promptDefaultAccount = removeSandboxAccountFromConfig(
|
|
120
|
+
sandboxAccountId
|
|
121
|
+
);
|
|
118
122
|
if (promptDefaultAccount) {
|
|
119
123
|
await selectAndSetAsDefaultAccountPrompt(config);
|
|
120
124
|
}
|
|
@@ -122,6 +126,8 @@ exports.handler = async options => {
|
|
|
122
126
|
} catch (err) {
|
|
123
127
|
debugErrorAndContext(err);
|
|
124
128
|
|
|
129
|
+
trackCommandUsage('sandbox-delete', { success: false }, sandboxAccountId);
|
|
130
|
+
|
|
125
131
|
if (
|
|
126
132
|
err.error &&
|
|
127
133
|
err.error.category === OBJECT_NOT_FOUND &&
|
|
@@ -135,7 +141,9 @@ exports.handler = async options => {
|
|
|
135
141
|
);
|
|
136
142
|
logger.log('');
|
|
137
143
|
|
|
138
|
-
const promptDefaultAccount =
|
|
144
|
+
const promptDefaultAccount = removeSandboxAccountFromConfig(
|
|
145
|
+
sandboxAccountId
|
|
146
|
+
);
|
|
139
147
|
if (promptDefaultAccount) {
|
|
140
148
|
await selectAndSetAsDefaultAccountPrompt(config);
|
|
141
149
|
}
|
package/lib/projects.js
CHANGED
|
@@ -224,6 +224,13 @@ const getProjectBuildDetailUrl = (projectName, buildId, accountId) => {
|
|
|
224
224
|
return `${getProjectDetailUrl(projectName, accountId)}/build/${buildId}`;
|
|
225
225
|
};
|
|
226
226
|
|
|
227
|
+
const getProjectDeployDetailUrl = (projectName, deployId, accountId) => {
|
|
228
|
+
if (!projectName || !deployId || !accountId) return;
|
|
229
|
+
return `${getProjectDetailUrl(
|
|
230
|
+
projectName,
|
|
231
|
+
accountId
|
|
232
|
+
)}/activity/deploy/${deployId}`;
|
|
233
|
+
};
|
|
227
234
|
const uploadProjectFiles = async (accountId, projectName, filePath) => {
|
|
228
235
|
const i18nKey = 'cli.commands.project.subcommands.upload';
|
|
229
236
|
const spinnies = new Spinnies({
|
|
@@ -347,7 +354,9 @@ const makePollTaskStatusFunc = ({
|
|
|
347
354
|
const displayId = deployedBuildId || taskId;
|
|
348
355
|
|
|
349
356
|
if (linkToHubSpot) {
|
|
350
|
-
logger.log(
|
|
357
|
+
logger.log(
|
|
358
|
+
`\n${linkToHubSpot(accountId, taskName, taskId, deployedBuildId)}\n`
|
|
359
|
+
);
|
|
351
360
|
}
|
|
352
361
|
|
|
353
362
|
const spinnies = new Spinnies({
|
|
@@ -471,10 +480,10 @@ const makePollTaskStatusFunc = ({
|
|
|
471
480
|
};
|
|
472
481
|
|
|
473
482
|
const pollBuildStatus = makePollTaskStatusFunc({
|
|
474
|
-
linkToHubSpot: (
|
|
483
|
+
linkToHubSpot: (accountId, taskName, taskId) =>
|
|
475
484
|
uiLink(
|
|
476
|
-
`View build #${
|
|
477
|
-
getProjectBuildDetailUrl(
|
|
485
|
+
`View build #${taskId} in HubSpot`,
|
|
486
|
+
getProjectBuildDetailUrl(taskName, taskId, accountId)
|
|
478
487
|
),
|
|
479
488
|
statusFn: getBuildStatus,
|
|
480
489
|
statusText: PROJECT_BUILD_TEXT,
|
|
@@ -490,6 +499,11 @@ const pollBuildStatus = makePollTaskStatusFunc({
|
|
|
490
499
|
});
|
|
491
500
|
|
|
492
501
|
const pollDeployStatus = makePollTaskStatusFunc({
|
|
502
|
+
linkToHubSpot: (accountId, taskName, taskId, deployedBuildId) =>
|
|
503
|
+
uiLink(
|
|
504
|
+
`View deploy of build #${deployedBuildId} in HubSpot`,
|
|
505
|
+
getProjectDeployDetailUrl(taskName, taskId, accountId)
|
|
506
|
+
),
|
|
493
507
|
statusFn: getDeployStatus,
|
|
494
508
|
statusText: PROJECT_DEPLOY_TEXT,
|
|
495
509
|
statusStrings: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/cli",
|
|
3
|
-
"version": "4.0.1
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "CLI for working with HubSpot",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"url": "https://github.com/HubSpot/hubspot-cms-tools"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@hubspot/cli-lib": "4.0.1
|
|
12
|
-
"@hubspot/serverless-dev-runtime": "4.0.1
|
|
11
|
+
"@hubspot/cli-lib": "4.0.1",
|
|
12
|
+
"@hubspot/serverless-dev-runtime": "4.0.1",
|
|
13
13
|
"archiver": "^5.3.0",
|
|
14
14
|
"chalk": "^4.1.2",
|
|
15
15
|
"express": "^4.17.1",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "416585f18c9b856b4da3ef502d1eccaded9281d5"
|
|
41
41
|
}
|