@salesforce/plugin-devops-center 0.1.0-beta.3 → 1.0.0-beta.2
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/README.md +25 -22
- package/lib/commands/project/deploy/pipeline/quick.d.ts +23 -0
- package/lib/commands/project/deploy/pipeline/quick.js +45 -0
- package/lib/commands/project/deploy/pipeline/quick.js.map +1 -0
- package/lib/commands/{deploy → project/deploy}/pipeline/report.d.ts +2 -2
- package/lib/commands/{deploy → project/deploy}/pipeline/report.js +2 -2
- package/lib/commands/project/deploy/pipeline/report.js.map +1 -0
- package/lib/commands/{deploy → project/deploy}/pipeline/resume.d.ts +3 -3
- package/lib/commands/{deploy → project/deploy}/pipeline/resume.js +3 -3
- package/lib/commands/project/deploy/pipeline/resume.js.map +1 -0
- package/lib/commands/{deploy/pipeline.d.ts → project/deploy/pipeline/start.d.ts} +6 -4
- package/lib/commands/{deploy/pipeline.js → project/deploy/pipeline/start.js} +6 -5
- package/lib/commands/project/deploy/pipeline/start.js.map +1 -0
- package/lib/commands/project/deploy/pipeline/validate.d.ts +19 -0
- package/lib/commands/project/deploy/pipeline/validate.js +37 -0
- package/lib/commands/project/deploy/pipeline/validate.js.map +1 -0
- package/lib/common/base/abstractAsyncOperation.d.ts +42 -0
- package/lib/common/base/abstractAsyncOperation.js +94 -0
- package/lib/common/base/abstractAsyncOperation.js.map +1 -0
- package/lib/common/base/abstractPromote.d.ts +8 -16
- package/lib/common/base/abstractPromote.js +19 -66
- package/lib/common/base/abstractPromote.js.map +1 -1
- package/lib/common/base/abstractQuick.d.ts +59 -0
- package/lib/common/base/abstractQuick.js +111 -0
- package/lib/common/base/abstractQuick.js.map +1 -0
- package/lib/common/base/abstractResume.d.ts +7 -13
- package/lib/common/base/abstractResume.js +9 -32
- package/lib/common/base/abstractResume.js.map +1 -1
- package/lib/common/constants.d.ts +2 -1
- package/lib/common/constants.js +1 -0
- package/lib/common/constants.js.map +1 -1
- package/lib/common/flags/flags.d.ts +5 -0
- package/lib/common/flags/flags.js +14 -6
- package/lib/common/flags/flags.js.map +1 -1
- package/lib/common/index.d.ts +1 -1
- package/lib/common/index.js.map +1 -1
- package/lib/common/outputColumns.d.ts +1 -0
- package/lib/common/outputColumns.js +2 -1
- package/lib/common/outputColumns.js.map +1 -1
- package/lib/common/outputService/aorOutputService.js +12 -6
- package/lib/common/outputService/aorOutputService.js.map +1 -1
- package/lib/common/outputService/deployCommandOutputService.d.ts +1 -1
- package/lib/common/outputService/deployCommandOutputService.js +2 -2
- package/lib/common/outputService/deployCommandOutputService.js.map +1 -1
- package/lib/common/outputService/deploySummaryBuilder.d.ts +13 -1
- package/lib/common/outputService/deploySummaryBuilder.js +64 -12
- package/lib/common/outputService/deploySummaryBuilder.js.map +1 -1
- package/lib/common/outputService/outputServiceFactory.d.ts +11 -5
- package/lib/common/outputService/outputServiceFactory.js +8 -2
- package/lib/common/outputService/outputServiceFactory.js.map +1 -1
- package/lib/common/outputService/promoteOutputService.d.ts +0 -6
- package/lib/common/outputService/promoteOutputService.js +0 -11
- package/lib/common/outputService/promoteOutputService.js.map +1 -1
- package/lib/common/outputService/reportOutputService.js +1 -1
- package/lib/common/outputService/reportOutputService.js.map +1 -1
- package/lib/common/outputService/resumeCommandOutputService.d.ts +7 -4
- package/lib/common/outputService/resumeCommandOutputService.js +8 -4
- package/lib/common/outputService/resumeCommandOutputService.js.map +1 -1
- package/lib/common/outputService/resumeOutputService.d.ts +7 -0
- package/lib/common/outputService/resumeOutputService.js +14 -0
- package/lib/common/outputService/resumeOutputService.js.map +1 -1
- package/lib/common/selectors/deployComponentsSelector.d.ts +1 -0
- package/lib/common/selectors/deployComponentsSelector.js +9 -1
- package/lib/common/selectors/deployComponentsSelector.js.map +1 -1
- package/lib/common/selectors/deployProgressSummarySelector.js +1 -1
- package/lib/common/selectors/deploymentResultsSelector.d.ts +19 -1
- package/lib/common/selectors/deploymentResultsSelector.js +29 -1
- package/lib/common/selectors/deploymentResultsSelector.js.map +1 -1
- package/lib/common/selectors/environmentSelector.d.ts +1 -1
- package/lib/common/selectors/environmentSelector.js +1 -1
- package/lib/common/selectors/pipelineStageSelector.d.ts +5 -0
- package/lib/common/selectors/pipelineStageSelector.js +13 -1
- package/lib/common/selectors/pipelineStageSelector.js.map +1 -1
- package/lib/common/selectors/validateDeploySelector.d.ts +6 -0
- package/lib/common/selectors/validateDeploySelector.js +22 -0
- package/lib/common/selectors/validateDeploySelector.js.map +1 -0
- package/lib/common/types.d.ts +11 -5
- package/lib/common/types.js +0 -6
- package/lib/common/types.js.map +1 -1
- package/lib/common/utils.d.ts +7 -1
- package/lib/common/utils.js +19 -6
- package/lib/common/utils.js.map +1 -1
- package/lib/streamer/processors/asyncOpStream.js +2 -1
- package/lib/streamer/processors/asyncOpStream.js.map +1 -1
- package/messages/commonFlags.md +6 -6
- package/messages/config.md +1 -1
- package/messages/deploy.output.md +18 -2
- package/messages/project.deploy.pipeline.quick.md +45 -0
- package/messages/{deploy.pipeline.report.md → project.deploy.pipeline.report.md} +3 -3
- package/messages/{deploy.pipeline.resume.md → project.deploy.pipeline.resume.md} +1 -5
- package/messages/{deploy.pipeline.md → project.deploy.pipeline.start.md} +5 -1
- package/messages/project.deploy.pipeline.validate.md +17 -0
- package/messages/promoteFlags.md +4 -4
- package/oclif.manifest.json +296 -67
- package/package.json +221 -110
- package/schemas/{deploy-pipeline-resume.json → project-deploy-pipeline-quick.json} +3 -3
- package/schemas/{deploy-pipeline.json → project-deploy-pipeline-resume.json} +3 -3
- package/schemas/project-deploy-pipeline-start.json +25 -0
- package/schemas/project-deploy-pipeline-validate.json +25 -0
- package/lib/commands/deploy/pipeline/report.js.map +0 -1
- package/lib/commands/deploy/pipeline/resume.js.map +0 -1
- package/lib/commands/deploy/pipeline.js.map +0 -1
- /package/schemas/{deploy-pipeline-report.json → project-deploy-pipeline-report.json} +0 -0
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
|
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
41
|
# Run using local run file.
|
|
42
|
-
./bin/dev deploy pipeline
|
|
42
|
+
./bin/dev project deploy pipeline start
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
|
|
@@ -47,6 +47,7 @@ There should be no differences when running via the Salesforce CLI or using the
|
|
|
47
47
|
```bash
|
|
48
48
|
# Link your plugin to the sf cli
|
|
49
49
|
sf plugins link .
|
|
50
|
+
|
|
50
51
|
# To verify
|
|
51
52
|
sf plugins
|
|
52
53
|
```
|
|
@@ -55,17 +56,17 @@ sf plugins
|
|
|
55
56
|
|
|
56
57
|
<!-- commands -->
|
|
57
58
|
|
|
58
|
-
- [`sf deploy pipeline`](#sf-deploy-pipeline)
|
|
59
|
-
- [`sf deploy pipeline report`](#sf-deploy-pipeline-report)
|
|
60
|
-
- [`sf deploy pipeline resume`](#sf-deploy-pipeline-resume)
|
|
59
|
+
- [`sf project deploy pipeline start`](#sf-project-deploy-pipeline-start)
|
|
60
|
+
- [`sf project deploy pipeline report`](#sf-project-deploy-pipeline-report)
|
|
61
|
+
- [`sf project deploy pipeline resume`](#sf-project-deploy-pipeline-resume)
|
|
61
62
|
|
|
62
|
-
## `sf deploy pipeline`
|
|
63
|
+
## `sf project deploy pipeline start`
|
|
63
64
|
|
|
64
65
|
Deploy changes from a branch to the pipeline stage’s org.
|
|
65
66
|
|
|
66
67
|
```
|
|
67
68
|
USAGE
|
|
68
|
-
$ sf deploy pipeline [--json] [-c <value>] [-p <value>] [-b <value>] [-v <value>] [-a] [--async | -w <value>] [--concise | --verbose]
|
|
69
|
+
$ sf project deploy pipeline start [--json] [-c <value>] [-p <value>] [-b <value>] [-v <value>] [-a] [--async | -w <value>] [--concise | --verbose]
|
|
69
70
|
[-t <value>] [-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg]
|
|
70
71
|
|
|
71
72
|
FLAGS
|
|
@@ -91,11 +92,11 @@ Before you run this command, changes in the branch must be merged in the source
|
|
|
91
92
|
EXAMPLES
|
|
92
93
|
Deploy changes in the Staging branch to the Staging environment (sandbox), if the previous stage is the bundling stage:
|
|
93
94
|
|
|
94
|
-
$ sf deploy pipeline —-devops-center-project-name “Recruiting App” —-branch-name staging —-devops-center-username MyStagingSandbox —-bundle-version-name 1.0
|
|
95
|
+
$ sf project deploy pipeline start —-devops-center-project-name “Recruiting App” —-branch-name staging —-devops-center-username MyStagingSandbox —-bundle-version-name 1.0
|
|
95
96
|
|
|
96
97
|
Deploy all changes in the main branch to the release environment:
|
|
97
98
|
|
|
98
|
-
$ sf deploy pipeline —-devops-center-project-name “Recruiting App” —-branch-name main —-devops-center-username MyReleaseOrg —-deploy-all
|
|
99
|
+
$ sf project deploy pipeline start —-devops-center-project-name “Recruiting App” —-branch-name main —-devops-center-username MyReleaseOrg —-deploy-all
|
|
99
100
|
|
|
100
101
|
FLAG DESCRIPTIONS
|
|
101
102
|
-a, --deploy-all Deploy all metadata in the branch
|
|
@@ -141,21 +142,21 @@ FLAG DESCRIPTIONS
|
|
|
141
142
|
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
142
143
|
|
|
143
144
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and returns the job ID.
|
|
144
|
-
To check the status of the deploy operation, run "sf deploy pipeline report".
|
|
145
|
+
To check the status of the deploy operation, run "sf project deploy pipeline report".
|
|
145
146
|
|
|
146
147
|
--async Run the command asynchronously.
|
|
147
148
|
|
|
148
149
|
The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the CLI. To resume the deployment,
|
|
149
|
-
run "sf deploy pipeline resume". To check the status of the deployment, run "sf deploy pipeline report".
|
|
150
|
+
run "sf project deploy pipeline resume". To check the status of the deployment, run "sf project deploy pipeline report".
|
|
150
151
|
```
|
|
151
152
|
|
|
152
|
-
## `sf deploy pipeline report`
|
|
153
|
+
## `sf project deploy pipeline report`
|
|
153
154
|
|
|
154
155
|
Check the status of a pipeline deploy operation.
|
|
155
156
|
|
|
156
157
|
```
|
|
157
158
|
USAGE
|
|
158
|
-
$ sf deploy pipeline report [--json] [-c <value>] [-i <value>] [-r]
|
|
159
|
+
$ sf project deploy pipeline report [--json] [-c <value>] [-i <value>] [-r]
|
|
159
160
|
|
|
160
161
|
FLAGS
|
|
161
162
|
-c, --devops-center-username=<value> Username or alias for the DevOps Center org.
|
|
@@ -173,11 +174,11 @@ DESCRIPTION
|
|
|
173
174
|
EXAMPLES
|
|
174
175
|
Check the status using a job ID:
|
|
175
176
|
|
|
176
|
-
$ sf deploy pipeline report --devops-center-username MyStagingSandbox --job-id 0Af0x000017yLUFCA2
|
|
177
|
+
$ sf project deploy pipeline report --devops-center-username MyStagingSandbox --job-id 0Af0x000017yLUFCA2
|
|
177
178
|
|
|
178
179
|
Check the status of the most recent deploy operation:
|
|
179
180
|
|
|
180
|
-
$ sf deploy pipeline report --devops-center-username MyStagingSandbox --use-most-recent
|
|
181
|
+
$ sf project deploy pipeline report --devops-center-username MyStagingSandbox --use-most-recent
|
|
181
182
|
|
|
182
183
|
FLAG DESCRIPTIONS
|
|
183
184
|
-c, --devops-center-username=<value> Username or alias for the DevOps Center org.
|
|
@@ -192,19 +193,21 @@ FLAG DESCRIPTIONS
|
|
|
192
193
|
|
|
193
194
|
```
|
|
194
195
|
|
|
195
|
-
## `sf deploy pipeline resume`
|
|
196
|
+
## `sf project deploy pipeline resume`
|
|
196
197
|
|
|
197
198
|
Resume watching a pipeline deploy operation.
|
|
198
199
|
|
|
199
200
|
```
|
|
200
201
|
USAGE
|
|
201
|
-
$ sf deploy pipeline resume [--json] [-c <value>] [-i <value>] [-r] [-w <value>]
|
|
202
|
+
$ sf project deploy pipeline resume [--json] [-c <value>] [-i <value>] [-r] [-w <value>] [--concise | --verbose]
|
|
202
203
|
|
|
203
204
|
FLAGS
|
|
204
205
|
-c, --devops-center-username=<value> Username or alias of the DevOps Center org.
|
|
205
206
|
-i, --job-id=<value> Job ID of the pipeline deploy operation you want to resume.
|
|
206
207
|
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
207
208
|
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
209
|
+
--concise Show concise output of the deploy result.
|
|
210
|
+
--verbose Show verbose output of the deploy result.
|
|
208
211
|
|
|
209
212
|
GLOBAL FLAGS
|
|
210
213
|
--json Format output as json.
|
|
@@ -218,20 +221,20 @@ Resume watching a pipeline deploy operation.
|
|
|
218
221
|
EXAMPLES
|
|
219
222
|
Resume watching a deploy operation using a job ID:
|
|
220
223
|
|
|
221
|
-
$ sf deploy pipeline resume --job-id 0Af0x000017yLUFCA2
|
|
224
|
+
$ sf project deploy pipeline resume --job-id 0Af0x000017yLUFCA2
|
|
222
225
|
|
|
223
226
|
Resume watching the most recent deploy operation:
|
|
224
227
|
|
|
225
|
-
$ sf deploy pipeline resume --use-most-recent
|
|
228
|
+
$ sf project deploy pipeline resume --use-most-recent
|
|
226
229
|
|
|
227
230
|
FLAG DESCRIPTIONS
|
|
228
231
|
-i, --job-id=<value> Job ID of the pipeline deploy operation you want to resume.
|
|
229
232
|
|
|
230
233
|
These commands return a job ID if they time out or you specified the --async flag:
|
|
231
234
|
|
|
232
|
-
- sf deploy pipeline
|
|
233
|
-
- sf deploy pipeline validate
|
|
234
|
-
- sf deploy pipeline quick
|
|
235
|
+
- sf project deploy pipeline start
|
|
236
|
+
- sf project deploy pipeline validate
|
|
237
|
+
- sf project deploy pipeline quick
|
|
235
238
|
|
|
236
239
|
The job ID is valid for 10 days from when you started the deploy operation.
|
|
237
240
|
|
|
@@ -241,5 +244,5 @@ Resume watching a pipeline deploy operation.
|
|
|
241
244
|
|
|
242
245
|
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
243
246
|
|
|
244
|
-
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and returns the job ID. To check the status of the operation, run "sf deploy pipeline
|
|
247
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and returns the job ID. To check the status of the operation, run "sf project deploy pipeline report".
|
|
245
248
|
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import QuickPromotionCommand from '../../../../common/base/abstractQuick';
|
|
3
|
+
import { AsyncOperationResultJson, PromoteOptions } from '../../../../common';
|
|
4
|
+
export default class DeployPipelineQuick extends QuickPromotionCommand<typeof SfCommand> {
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly summary: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly state = "beta";
|
|
9
|
+
protected baseCommand: string;
|
|
10
|
+
private readonly isUndeployedOnly;
|
|
11
|
+
run(): Promise<AsyncOperationResultJson>;
|
|
12
|
+
/**
|
|
13
|
+
* Computes the source stage Id for quick promotions. Quick promotions are allowed only
|
|
14
|
+
* in versioned promotions so source stage is previous stage.
|
|
15
|
+
*
|
|
16
|
+
* @returns: string. It is the source stage Id.
|
|
17
|
+
*/
|
|
18
|
+
protected getSourceStageId(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the promote option necessary to performs an undeployed only promotion.
|
|
21
|
+
*/
|
|
22
|
+
protected getPromoteOptions(): Partial<PromoteOptions>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
* Licensed under the BSD 3-Clause license.
|
|
7
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
|
+
*/
|
|
9
|
+
const core_1 = require("@salesforce/core");
|
|
10
|
+
const abstractQuick_1 = require("../../../../common/base/abstractQuick");
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.quick');
|
|
13
|
+
class DeployPipelineQuick extends abstractQuick_1.default {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.baseCommand = 'project deploy pipeline';
|
|
17
|
+
this.isUndeployedOnly = true;
|
|
18
|
+
}
|
|
19
|
+
async run() {
|
|
20
|
+
return this.executeQuickPromotion();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Computes the source stage Id for quick promotions. Quick promotions are allowed only
|
|
24
|
+
* in versioned promotions so source stage is previous stage.
|
|
25
|
+
*
|
|
26
|
+
* @returns: string. It is the source stage Id.
|
|
27
|
+
*/
|
|
28
|
+
getSourceStageId() {
|
|
29
|
+
// for versioned promotions we always have a previous stage
|
|
30
|
+
const prevStages = this.getTargetStage().sf_devops__Pipeline_Stages__r;
|
|
31
|
+
return prevStages.records[0].Id;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns the promote option necessary to performs an undeployed only promotion.
|
|
35
|
+
*/
|
|
36
|
+
getPromoteOptions() {
|
|
37
|
+
return { undeployedOnly: this.isUndeployedOnly };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = DeployPipelineQuick;
|
|
41
|
+
DeployPipelineQuick.description = messages.getMessage('description');
|
|
42
|
+
DeployPipelineQuick.summary = messages.getMessage('summary');
|
|
43
|
+
DeployPipelineQuick.examples = messages.getMessages('examples');
|
|
44
|
+
DeployPipelineQuick.state = 'beta';
|
|
45
|
+
//# sourceMappingURL=quick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/quick.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,2CAA4C;AAE5C,yEAA0E;AAI1E,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,+BAA+B,CAAC,CAAC;AAE5G,MAAqB,mBAAoB,SAAQ,uBAAuC;IAAxF;;QAMY,gBAAW,GAAG,yBAAyB,CAAC;QACjC,qBAAgB,GAAG,IAAI,CAAC;IAwB3C,CAAC;IAtBQ,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACO,gBAAgB;QACxB,2DAA2D;QAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,6BAAuD,CAAC;QACjG,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACO,iBAAiB;QACzB,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC;;AA9BH,sCA+BC;AA9BwB,+BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,2BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,4BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,yBAAK,GAAG,MAAM,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { PromotePipelineResult } from '
|
|
3
|
-
import { ReportOnPromoteCommand } from '
|
|
2
|
+
import { PromotePipelineResult } from '../../../../common';
|
|
3
|
+
import { ReportOnPromoteCommand } from '../../../../common/base/abstractReportOnPromote';
|
|
4
4
|
export default class DeployPipelineReport extends ReportOnPromoteCommand<typeof SfCommand> {
|
|
5
5
|
static readonly description: string;
|
|
6
6
|
static readonly summary: string;
|
|
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
*/
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
10
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
11
|
-
const abstractReportOnPromote_1 = require("
|
|
11
|
+
const abstractReportOnPromote_1 = require("../../../../common/base/abstractReportOnPromote");
|
|
12
12
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
13
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'deploy.pipeline.report');
|
|
13
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.report');
|
|
14
14
|
class DeployPipelineReport extends abstractReportOnPromote_1.ReportOnPromoteCommand {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/report.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,2CAA4C;AAC5C,iEAA+D;AAE/D,6FAAyF;AAEzF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,gCAAgC,CAAC,CAAC;AAE7G,MAAqB,oBAAqB,SAAQ,gDAAwC;IAA1F;;QAmBY,kBAAa,GAAG,QAAQ,CAAC;IAKrC,CAAC;IAHQ,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;IACnC,CAAC;;AAvBH,uCAwBC;AAvBwB,gCAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,4BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,6BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,0BAAK,GAAG,MAAM,CAAC;AACxB,0BAAK,GAAG;IACpB,QAAQ,EAAE,uBAAK,CAAC,YAAY,CAAC;QAC3B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QAC5D,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;IACF,iBAAiB,EAAE,uBAAK,CAAC,OAAO,CAAC;QAC/B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,mCAAmC,CAAC;QACrE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;QAC7D,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;CACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import {
|
|
3
|
-
import { ResumeCommand } from '
|
|
2
|
+
import { AsyncOperationResultJson } from '../../../../common';
|
|
3
|
+
import { ResumeCommand } from '../../../../common/base/abstractResume';
|
|
4
4
|
export default class DeployPipelineResume extends ResumeCommand<typeof SfCommand> {
|
|
5
5
|
static readonly summary: string;
|
|
6
6
|
static readonly description: string;
|
|
@@ -8,5 +8,5 @@ export default class DeployPipelineResume extends ResumeCommand<typeof SfCommand
|
|
|
8
8
|
static readonly state = "beta";
|
|
9
9
|
protected operationType: string;
|
|
10
10
|
protected baseCommand: string;
|
|
11
|
-
run(): Promise<
|
|
11
|
+
run(): Promise<AsyncOperationResultJson>;
|
|
12
12
|
}
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
|
-
const abstractResume_1 = require("
|
|
10
|
+
const abstractResume_1 = require("../../../../common/base/abstractResume");
|
|
11
11
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'deploy.pipeline.resume');
|
|
12
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.resume');
|
|
13
13
|
class DeployPipelineResume extends abstractResume_1.ResumeCommand {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.operationType = 'Deployment';
|
|
17
|
-
this.baseCommand = 'deploy pipeline';
|
|
17
|
+
this.baseCommand = 'project deploy pipeline';
|
|
18
18
|
}
|
|
19
19
|
async run() {
|
|
20
20
|
return this.resumeOperation();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/resume.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA4C;AAG5C,2EAAuE;AAEvE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,gCAAgC,CAAC,CAAC;AAE7G,MAAqB,oBAAqB,SAAQ,8BAA+B;IAAjF;;QAMY,kBAAa,GAAG,YAAY,CAAC;QAC7B,gBAAW,GAAG,yBAAyB,CAAC;IAKpD,CAAC;IAHQ,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAChC,CAAC;;AAXH,uCAYC;AAXwB,4BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,gCAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,6BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,0BAAK,GAAG,MAAM,CAAC"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { PromoteCommand } from '
|
|
3
|
-
import { PromoteOptions
|
|
2
|
+
import { PromoteCommand } from '../../../../common/base/abstractPromote';
|
|
3
|
+
import { PromoteOptions } from '../../../../common';
|
|
4
|
+
import { AsyncOperationResultJson } from '../../../../common/types';
|
|
4
5
|
/**
|
|
5
|
-
* Contains the logic to execute the sf deploy pipeline command.
|
|
6
|
+
* Contains the logic to execute the sf project deploy pipeline start command.
|
|
6
7
|
*/
|
|
7
8
|
export default class DeployPipeline extends PromoteCommand<typeof SfCommand> {
|
|
8
9
|
static readonly summary: string;
|
|
9
10
|
static readonly description: string;
|
|
10
11
|
static readonly examples: string[];
|
|
11
12
|
static readonly state = "beta";
|
|
13
|
+
protected baseCommand: string;
|
|
12
14
|
private readonly isUndeployedOnly;
|
|
13
|
-
run(): Promise<
|
|
15
|
+
run(): Promise<AsyncOperationResultJson>;
|
|
14
16
|
/**
|
|
15
17
|
* Computes the source stage Id for deployOnly promotions. If the given stage has a previous stage
|
|
16
18
|
* then the source stage is the previous stage. If not the it means this is the
|
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
|
-
const abstractPromote_1 = require("
|
|
11
|
-
const constants_1 = require("
|
|
10
|
+
const abstractPromote_1 = require("../../../../common/base/abstractPromote");
|
|
11
|
+
const constants_1 = require("../../../../common/constants");
|
|
12
12
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
13
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'deploy.pipeline');
|
|
13
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.start');
|
|
14
14
|
/**
|
|
15
|
-
* Contains the logic to execute the sf deploy pipeline command.
|
|
15
|
+
* Contains the logic to execute the sf project deploy pipeline start command.
|
|
16
16
|
*/
|
|
17
17
|
class DeployPipeline extends abstractPromote_1.PromoteCommand {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
|
+
this.baseCommand = 'project deploy pipeline';
|
|
20
21
|
this.isUndeployedOnly = true;
|
|
21
22
|
}
|
|
22
23
|
async run() {
|
|
@@ -47,4 +48,4 @@ DeployPipeline.summary = messages.getMessage('summary');
|
|
|
47
48
|
DeployPipeline.description = messages.getMessage('description');
|
|
48
49
|
DeployPipeline.examples = messages.getMessages('examples');
|
|
49
50
|
DeployPipeline.state = 'beta';
|
|
50
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=start.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/start.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA4C;AAE5C,6EAAyE;AAEzE,4DAAwD;AAGxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,+BAA+B,CAAC,CAAC;AAE5G;;GAEG;AACH,MAAqB,cAAe,SAAQ,gCAAgC;IAA5E;;QAKY,gBAAW,GAAG,yBAAyB,CAAC;QACjC,qBAAgB,GAAG,IAAI,CAAC;IA0B3C,CAAC;IAxBQ,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;IAED;;;;;;OAMG;IACO,gBAAgB;QACxB,MAAM,WAAW,GAAkB,IAAI,CAAC,cAAc,EAAE,CAAC;QACzD,OAAO,WAAW,CAAC,6BAA6B;YAC9C,CAAC,CAAC,WAAW,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;YACzD,CAAC,CAAC,oBAAQ,CAAC;IACf,CAAC;IAED;;OAEG;IACO,iBAAiB;QACzB,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC;;AA/BH,iCAgCC;AA/BwB,sBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,0BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,uBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,oBAAK,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PromoteOptions } from '../../../../common';
|
|
2
|
+
import { AsyncOperationResultJson } from '../../../../common/types';
|
|
3
|
+
import DeployPipeline from './start';
|
|
4
|
+
/**
|
|
5
|
+
* Contains the logic to execute the sf project deploy pipeline validate command.
|
|
6
|
+
*/
|
|
7
|
+
export default class ValidateDeployPipeline extends DeployPipeline {
|
|
8
|
+
static readonly summary: string;
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly state = "beta";
|
|
12
|
+
protected baseCommand: string;
|
|
13
|
+
private readonly isCheckDeploy;
|
|
14
|
+
run(): Promise<AsyncOperationResultJson>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the promote option necessary to perform a validate deploy
|
|
17
|
+
*/
|
|
18
|
+
protected getPromoteOptions(): Partial<PromoteOptions>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const core_1 = require("@salesforce/core");
|
|
10
|
+
const start_1 = require("./start");
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.validate');
|
|
13
|
+
/**
|
|
14
|
+
* Contains the logic to execute the sf project deploy pipeline validate command.
|
|
15
|
+
*/
|
|
16
|
+
class ValidateDeployPipeline extends start_1.default {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.baseCommand = 'project deploy pipeline';
|
|
20
|
+
this.isCheckDeploy = true;
|
|
21
|
+
}
|
|
22
|
+
async run() {
|
|
23
|
+
return this.executePromotion();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the promote option necessary to perform a validate deploy
|
|
27
|
+
*/
|
|
28
|
+
getPromoteOptions() {
|
|
29
|
+
return { ...super.getPromoteOptions(), checkDeploy: this.isCheckDeploy };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = ValidateDeployPipeline;
|
|
33
|
+
ValidateDeployPipeline.summary = messages.getMessage('summary');
|
|
34
|
+
ValidateDeployPipeline.description = messages.getMessage('description');
|
|
35
|
+
ValidateDeployPipeline.examples = messages.getMessages('examples');
|
|
36
|
+
ValidateDeployPipeline.state = 'beta';
|
|
37
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/validate.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA4C;AAG5C,mCAAqC;AAErC,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,kCAAkC,CAAC,CAAC;AAE/G;;GAEG;AACH,MAAqB,sBAAuB,SAAQ,eAAc;IAAlE;;QAKY,gBAAW,GAAG,yBAAyB,CAAC;QACjC,kBAAa,GAAG,IAAI,CAAC;IAYxC,CAAC;IAVQ,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACO,iBAAiB;QACzB,OAAO,EAAE,GAAG,KAAK,CAAC,iBAAiB,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;IAC3E,CAAC;;AAjBH,yCAkBC;AAjBwB,8BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,kCAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,+BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,4BAAK,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Org, SfError } from '@salesforce/core';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { Duration } from '@salesforce/kit';
|
|
4
|
+
import { AsyncOperationResultJson } from '../types';
|
|
5
|
+
import { PromoteOutputService } from '../outputService';
|
|
6
|
+
export declare abstract class AsyncCommand extends SfCommand<AsyncOperationResultJson> {
|
|
7
|
+
protected targetOrg: Org;
|
|
8
|
+
private asyncOperationId;
|
|
9
|
+
private outputService;
|
|
10
|
+
protected abstract baseCommand: string;
|
|
11
|
+
protected setAsyncOperationId(aorId: string): void;
|
|
12
|
+
protected setOutputService(service: PromoteOutputService): void;
|
|
13
|
+
/**
|
|
14
|
+
* Method to handle an in progress async operation. It stores the AOR in cache,
|
|
15
|
+
* then monitors the state of it and print messages if needed. Finally returns the
|
|
16
|
+
* final state of the operation.
|
|
17
|
+
*/
|
|
18
|
+
protected monitorOperation(isAsync: boolean, wait: Duration): Promise<AsyncOperationResultJson>;
|
|
19
|
+
/**
|
|
20
|
+
* Default function for catching commands errors.
|
|
21
|
+
*
|
|
22
|
+
* @param error
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
protected catch(error: Error | SfError): Promise<SfCommand.Error>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* Stores the AOR Id in cache.
|
|
29
|
+
*/
|
|
30
|
+
protected cacheOperation(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* Executes a query to get the state of the AOR record.
|
|
34
|
+
*/
|
|
35
|
+
private getOperationState;
|
|
36
|
+
/**
|
|
37
|
+
* Watch changes in the state of the AOR.
|
|
38
|
+
*
|
|
39
|
+
* @param wait
|
|
40
|
+
*/
|
|
41
|
+
private startMonitoring;
|
|
42
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncCommand = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const deployPipelineCache_1 = require("../deployPipelineCache");
|
|
13
|
+
const types_1 = require("../types");
|
|
14
|
+
const common_1 = require("../../common");
|
|
15
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
17
|
+
class AsyncCommand extends sf_plugins_core_1.SfCommand {
|
|
18
|
+
setAsyncOperationId(aorId) {
|
|
19
|
+
this.asyncOperationId = aorId;
|
|
20
|
+
}
|
|
21
|
+
setOutputService(service) {
|
|
22
|
+
this.outputService = service;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Method to handle an in progress async operation. It stores the AOR in cache,
|
|
26
|
+
* then monitors the state of it and print messages if needed. Finally returns the
|
|
27
|
+
* final state of the operation.
|
|
28
|
+
*/
|
|
29
|
+
async monitorOperation(isAsync, wait) {
|
|
30
|
+
await this.cacheOperation();
|
|
31
|
+
this.outputService.setAorId(this.asyncOperationId);
|
|
32
|
+
this.outputService.printAorId();
|
|
33
|
+
this.outputService.printOpSummary();
|
|
34
|
+
if (isAsync) {
|
|
35
|
+
return this.getOperationState();
|
|
36
|
+
}
|
|
37
|
+
await this.startMonitoring(wait);
|
|
38
|
+
if (this.outputService.getStatus() === types_1.AsyncOperationStatus.Completed) {
|
|
39
|
+
this.outputService.displayEndResults();
|
|
40
|
+
}
|
|
41
|
+
return this.getOperationState();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Default function for catching commands errors.
|
|
45
|
+
*
|
|
46
|
+
* @param error
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
catch(error) {
|
|
50
|
+
if (error.name.includes('GenericTimeoutError')) {
|
|
51
|
+
const err = messages.createError('error.ClientTimeout', [this.config.bin, this.baseCommand]);
|
|
52
|
+
return super.catch({ ...error, name: err.name, message: err.message, code: err.code });
|
|
53
|
+
}
|
|
54
|
+
return super.catch(error);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* Stores the AOR Id in cache.
|
|
59
|
+
*/
|
|
60
|
+
async cacheOperation() {
|
|
61
|
+
await deployPipelineCache_1.DeployPipelineCache.set(this.asyncOperationId, {});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* Executes a query to get the state of the AOR record.
|
|
66
|
+
*/
|
|
67
|
+
async getOperationState() {
|
|
68
|
+
const asyncJob = await (0, common_1.fetchAsyncOperationResult)(this.targetOrg.getConnection(), this.asyncOperationId);
|
|
69
|
+
return {
|
|
70
|
+
jobId: this.asyncOperationId,
|
|
71
|
+
status: asyncJob.sf_devops__Status__c,
|
|
72
|
+
message: asyncJob.sf_devops__Message__c,
|
|
73
|
+
errorDetails: asyncJob.sf_devops__Error_Details__c,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Watch changes in the state of the AOR.
|
|
78
|
+
*
|
|
79
|
+
* @param wait
|
|
80
|
+
*/
|
|
81
|
+
async startMonitoring(wait) {
|
|
82
|
+
const asyncJob = await (0, common_1.fetchAsyncOperationResult)(this.targetOrg.getConnection(), this.asyncOperationId);
|
|
83
|
+
if (asyncJob.sf_devops__Status__c === undefined ||
|
|
84
|
+
asyncJob.sf_devops__Status__c === types_1.AsyncOperationStatus.InProgress) {
|
|
85
|
+
const streamer = (0, common_1.getAsyncOperationStreamer)(this.targetOrg, wait, this.asyncOperationId, this.outputService);
|
|
86
|
+
await streamer.monitor();
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.outputService.printAorStatus(asyncJob);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.AsyncCommand = AsyncCommand;
|
|
94
|
+
//# sourceMappingURL=abstractAsyncOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractAsyncOperation.js","sourceRoot":"","sources":["../../../src/common/base/abstractAsyncOperation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Org
|
|
1
|
+
import { Org } from '@salesforce/core';
|
|
2
2
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
3
|
import { Interfaces } from '@oclif/core';
|
|
4
|
-
import { PipelineStage, PromoteOptions
|
|
4
|
+
import { PipelineStage, PromoteOptions } from '..';
|
|
5
|
+
import { AsyncOperationResultJson } from '../../common';
|
|
6
|
+
import { AsyncCommand } from './abstractAsyncOperation';
|
|
5
7
|
export type Flags<T extends typeof SfCommand> = Interfaces.InferredFlags<(typeof PromoteCommand)['baseFlags'] & T['flags']>;
|
|
6
|
-
export declare abstract class PromoteCommand<T extends typeof SfCommand> extends
|
|
8
|
+
export declare abstract class PromoteCommand<T extends typeof SfCommand> extends AsyncCommand {
|
|
7
9
|
static baseFlags: {
|
|
8
10
|
'branch-name': Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
11
|
'bundle-version-name': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -22,36 +24,26 @@ export declare abstract class PromoteCommand<T extends typeof SfCommand> extends
|
|
|
22
24
|
private sourceStageId;
|
|
23
25
|
private deployOptions;
|
|
24
26
|
private numRetries409;
|
|
25
|
-
private outputService;
|
|
26
27
|
init(): Promise<void>;
|
|
27
|
-
protected executePromotion(): Promise<
|
|
28
|
+
protected executePromotion(): Promise<AsyncOperationResultJson>;
|
|
28
29
|
/**
|
|
29
30
|
*
|
|
30
31
|
* Sends an Http request to the target org to initiate a promotion.
|
|
31
32
|
*
|
|
32
|
-
* @param doceOrg target org.
|
|
33
33
|
* @returns Aor Id of promote operation.
|
|
34
34
|
*/
|
|
35
|
-
protected requestPromotionFlow(
|
|
35
|
+
protected requestPromotionFlow(): Promise<string>;
|
|
36
36
|
/**
|
|
37
37
|
*
|
|
38
38
|
* Sends an Http request to the target org to initiate a promotion.
|
|
39
39
|
* If it gets a 409/Conflict it will retry till the request successes,
|
|
40
40
|
* gets a differenct error or run out of retry attempts.
|
|
41
41
|
*
|
|
42
|
-
* @param doceOrg target org.
|
|
43
42
|
* @param numRetries Amount of remaining retry attempts.
|
|
44
43
|
* @returns Aor Id of promote operation
|
|
45
44
|
*/
|
|
46
|
-
protected retryRequestPromotion(
|
|
45
|
+
protected retryRequestPromotion(numRetries: number): Promise<string>;
|
|
47
46
|
protected getTargetStage(): PipelineStage;
|
|
48
|
-
/**
|
|
49
|
-
* Default function for catching commands errors.
|
|
50
|
-
*
|
|
51
|
-
* @param error
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
|
-
protected catch(error: Error | SfError): Promise<SfCommand.Error>;
|
|
55
47
|
private requestPromotion;
|
|
56
48
|
private buildPromoteOptions;
|
|
57
49
|
/**
|