@salesforce/plugin-devops-center 1.0.0-beta.1 → 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 +3 -1
- 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/project/deploy/pipeline/resume.d.ts +3 -2
- package/lib/commands/project/deploy/pipeline/resume.js +1 -0
- package/lib/commands/project/deploy/pipeline/resume.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/start.d.ts +4 -2
- package/lib/commands/project/deploy/pipeline/start.js +1 -0
- package/lib/commands/project/deploy/pipeline/start.js.map +1 -1
- 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 -69
- 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 -12
- package/lib/common/base/abstractResume.js +9 -35
- 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/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 +1 -0
- 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 +12 -0
- package/lib/common/outputService/deploySummaryBuilder.js +59 -5
- 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/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/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/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 +10 -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 +16 -3
- 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 +2 -2
- package/messages/config.md +1 -1
- package/messages/deploy.output.md +18 -2
- package/messages/project.deploy.pipeline.quick.md +45 -0
- package/messages/project.deploy.pipeline.report.md +3 -3
- package/messages/project.deploy.pipeline.resume.md +1 -1
- package/messages/project.deploy.pipeline.start.md +5 -1
- package/messages/project.deploy.pipeline.validate.md +17 -0
- package/messages/promoteFlags.md +3 -3
- package/oclif.manifest.json +238 -9
- package/package.json +221 -115
- package/schemas/project-deploy-pipeline-quick.json +25 -0
- package/schemas/project-deploy-pipeline-resume.json +3 -3
- package/schemas/project-deploy-pipeline-start.json +3 -3
- package/schemas/project-deploy-pipeline-validate.json +25 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
import { Org } from '@salesforce/core';
|
|
3
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
4
|
+
import { PipelineStage, PromoteOptions } from '..';
|
|
5
|
+
import { AsyncOperationResultJson } from '../../common';
|
|
6
|
+
import { AsyncCommand } from './abstractAsyncOperation';
|
|
7
|
+
export type Flags<T extends typeof SfCommand> = Interfaces.InferredFlags<(typeof QuickPromotionCommand)['baseFlags'] & T['flags']>;
|
|
8
|
+
export default abstract class QuickPromotionCommand<T extends typeof SfCommand> extends AsyncCommand {
|
|
9
|
+
static baseFlags: {
|
|
10
|
+
async: Interfaces.BooleanFlag<boolean>;
|
|
11
|
+
concise: Interfaces.BooleanFlag<boolean>;
|
|
12
|
+
verbose: Interfaces.BooleanFlag<boolean>;
|
|
13
|
+
wait: Interfaces.OptionFlag<import("@salesforce/kit").Duration, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
'devops-center-username': Interfaces.OptionFlag<Org | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
'job-id': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
|
+
'use-most-recent': Interfaces.BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
protected flags: Flags<T>;
|
|
19
|
+
private targetStage;
|
|
20
|
+
private deployOptions;
|
|
21
|
+
init(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* Knows how to perform a quick promotion and watch its progress.
|
|
25
|
+
*/
|
|
26
|
+
executeQuickPromotion(): Promise<AsyncOperationResultJson>;
|
|
27
|
+
protected getTargetStage(): PipelineStage;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* Build a promotion request for a quick promotion and send it to the target org.
|
|
31
|
+
*
|
|
32
|
+
* @param projectId ID of the project.
|
|
33
|
+
* @param sourceStageId ID of the source stage.
|
|
34
|
+
* @param deploymentId ID of the validate deployemnt to use for quick deploy.
|
|
35
|
+
*/
|
|
36
|
+
private requestPromotion;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* Obtain the deployment ID to use for quick promotion.
|
|
40
|
+
*/
|
|
41
|
+
private getDeploymentResultForQuickDeploy;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* Build the promote options for a quick promotion.
|
|
45
|
+
*/
|
|
46
|
+
private buildPromoteOptions;
|
|
47
|
+
/**
|
|
48
|
+
* Knows how to compute the target pipeline stage Id based on the type of promotion.
|
|
49
|
+
*
|
|
50
|
+
* @returns: string. It is the source stage Id.
|
|
51
|
+
*/
|
|
52
|
+
protected abstract getSourceStageId(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the specific promote options specific for every concrete implementations.
|
|
55
|
+
*
|
|
56
|
+
* @returns: Partial<PromoteOptions>.
|
|
57
|
+
*/
|
|
58
|
+
protected abstract getPromoteOptions(): Partial<PromoteOptions>;
|
|
59
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@salesforce/core");
|
|
4
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
5
|
+
const __1 = require("..");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const deployPipelineCache_1 = require("../deployPipelineCache");
|
|
8
|
+
const promoteFlags_1 = require("../flags/promote/promoteFlags");
|
|
9
|
+
const flags_1 = require("../flags/flags");
|
|
10
|
+
const outputService_1 = require("../outputService");
|
|
11
|
+
const deploymentResultsSelector_1 = require("../selectors/deploymentResultsSelector");
|
|
12
|
+
const pipelineStageSelector_1 = require("../selectors/pipelineStageSelector");
|
|
13
|
+
const abstractAsyncOperation_1 = require("./abstractAsyncOperation");
|
|
14
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
15
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.quick');
|
|
16
|
+
class QuickPromotionCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
17
|
+
async init() {
|
|
18
|
+
await super.init();
|
|
19
|
+
const { flags } = await this.parse({
|
|
20
|
+
flags: this.ctor.flags,
|
|
21
|
+
baseFlags: super.ctor.baseFlags,
|
|
22
|
+
});
|
|
23
|
+
this.flags = flags;
|
|
24
|
+
this.targetOrg = this.flags['devops-center-username'];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* Knows how to perform a quick promotion and watch its progress.
|
|
29
|
+
*/
|
|
30
|
+
async executeQuickPromotion() {
|
|
31
|
+
const deploymentResult = await this.getDeploymentResultForQuickDeploy();
|
|
32
|
+
const envId = deploymentResult.sf_devops__Change_Bundle_Installs__r.records[0].sf_devops__Environment__c;
|
|
33
|
+
this.targetStage = (await (0, pipelineStageSelector_1.selectOnePipelineStageByEnvironmentId)(this.targetOrg.getConnection(), envId));
|
|
34
|
+
this.setOutputService(new outputService_1.OutputServiceFactory().forQuickDeployment(this.flags, this.flags['devops-center-username'].getConnection(), this.targetStage.sf_devops__Branch__r.sf_devops__Name__c));
|
|
35
|
+
this.setAsyncOperationId(await this.requestPromotion(this.targetStage.sf_devops__Pipeline__r.sf_devops__Project__c, this.getSourceStageId(), deploymentResult.sf_devops__Deployment_Id__c));
|
|
36
|
+
return this.monitorOperation(this.flags.async, this.flags.wait);
|
|
37
|
+
}
|
|
38
|
+
getTargetStage() {
|
|
39
|
+
return this.targetStage;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* Build a promotion request for a quick promotion and send it to the target org.
|
|
44
|
+
*
|
|
45
|
+
* @param projectId ID of the project.
|
|
46
|
+
* @param sourceStageId ID of the source stage.
|
|
47
|
+
* @param deploymentId ID of the validate deployemnt to use for quick deploy.
|
|
48
|
+
*/
|
|
49
|
+
async requestPromotion(projectId, sourceStageId, deploymentId) {
|
|
50
|
+
this.buildPromoteOptions(deploymentId);
|
|
51
|
+
const req = {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
url: `${constants_1.REST_PROMOTE_BASE_URL}${projectId}/pipelineName/${sourceStageId}`,
|
|
54
|
+
body: JSON.stringify({
|
|
55
|
+
promoteOptions: this.deployOptions,
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
58
|
+
const response = await this.targetOrg.getConnection().request(req);
|
|
59
|
+
return response.jobId;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* Obtain the deployment ID to use for quick promotion.
|
|
64
|
+
*/
|
|
65
|
+
async getDeploymentResultForQuickDeploy() {
|
|
66
|
+
const asyncJobId = this.flags['use-most-recent']
|
|
67
|
+
? (await deployPipelineCache_1.DeployPipelineCache.create()).getLatestKeyOrThrow()
|
|
68
|
+
: this.flags['job-id'];
|
|
69
|
+
const deploymentResult = await (0, deploymentResultsSelector_1.selectOneDeploymentResultWithChangeBundleInstallsByAsyncJobId)(this.targetOrg.getConnection(), asyncJobId);
|
|
70
|
+
if (!deploymentResult) {
|
|
71
|
+
throw messages.createError('error.JobIsNotValidationDeployment');
|
|
72
|
+
}
|
|
73
|
+
if (deploymentResult.sf_devops__Check_Deploy_Status__r.sf_devops__Status__c !== __1.AsyncOperationStatus.Completed) {
|
|
74
|
+
throw messages.createError('error.JobIsNotValidated');
|
|
75
|
+
}
|
|
76
|
+
return deploymentResult;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* Build the promote options for a quick promotion.
|
|
81
|
+
*/
|
|
82
|
+
buildPromoteOptions(deployId) {
|
|
83
|
+
this.deployOptions = {
|
|
84
|
+
testLevel: 'Default',
|
|
85
|
+
deploymentId: deployId,
|
|
86
|
+
// get more promote options from the concrete implementation if needed
|
|
87
|
+
...this.getPromoteOptions(),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.default = QuickPromotionCommand;
|
|
92
|
+
QuickPromotionCommand.baseFlags = {
|
|
93
|
+
async: promoteFlags_1.async,
|
|
94
|
+
concise: flags_1.concise,
|
|
95
|
+
verbose: flags_1.verbose,
|
|
96
|
+
wait: flags_1.wait,
|
|
97
|
+
'devops-center-username': (0, flags_1.requiredDoceOrgFlag)(),
|
|
98
|
+
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
99
|
+
char: 'i',
|
|
100
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
101
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
102
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
103
|
+
}),
|
|
104
|
+
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
105
|
+
char: 'r',
|
|
106
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
107
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
108
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
109
|
+
}),
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=abstractQuick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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D,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;CACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
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 {
|
|
4
|
+
import { AsyncOperationResultJson, AsyncOperationStatus } from '../../common';
|
|
5
|
+
import { AsyncCommand } from './abstractAsyncOperation';
|
|
5
6
|
/**
|
|
6
7
|
* Helper to determine if an operation has finished and therefore is not resumable
|
|
7
8
|
*
|
|
@@ -14,23 +15,17 @@ export type Flags<T extends typeof SfCommand> = Interfaces.InferredFlags<(typeof
|
|
|
14
15
|
*
|
|
15
16
|
* Base class with the common logic to resume an in progress opeation
|
|
16
17
|
*/
|
|
17
|
-
export declare abstract class ResumeCommand<T extends typeof SfCommand> extends
|
|
18
|
+
export declare abstract class ResumeCommand<T extends typeof SfCommand> extends AsyncCommand {
|
|
18
19
|
static baseFlags: {
|
|
19
20
|
'devops-center-username': Interfaces.OptionFlag<Org | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
21
|
'job-id': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
22
|
'use-most-recent': Interfaces.BooleanFlag<boolean>;
|
|
23
|
+
concise: Interfaces.BooleanFlag<boolean>;
|
|
24
|
+
verbose: Interfaces.BooleanFlag<boolean>;
|
|
22
25
|
wait: Interfaces.OptionFlag<import("@salesforce/kit").Duration, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
26
|
};
|
|
24
27
|
protected flags: Flags<T>;
|
|
25
|
-
private outputService;
|
|
26
28
|
protected abstract operationType: string;
|
|
27
29
|
init(): Promise<void>;
|
|
28
|
-
protected resumeOperation(): Promise<
|
|
29
|
-
/**
|
|
30
|
-
* Default function for catching commands errors.
|
|
31
|
-
*
|
|
32
|
-
* @param error
|
|
33
|
-
* @returns
|
|
34
|
-
*/
|
|
35
|
-
protected catch(error: Error | SfError): Promise<SfCommand.Error>;
|
|
30
|
+
protected resumeOperation(): Promise<AsyncOperationResultJson>;
|
|
36
31
|
}
|
|
@@ -8,11 +8,11 @@ exports.ResumeCommand = exports.isNotResumable = void 0;
|
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
10
|
const core_1 = require("@salesforce/core");
|
|
11
|
-
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
11
|
const common_1 = require("../../common");
|
|
13
12
|
const flags_1 = require("../../common/flags/flags");
|
|
14
13
|
const deployPipelineCache_1 = require("./../deployPipelineCache");
|
|
15
14
|
const outputService_1 = require("./../outputService");
|
|
15
|
+
const abstractAsyncOperation_1 = require("./abstractAsyncOperation");
|
|
16
16
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
17
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
18
18
|
/**
|
|
@@ -29,7 +29,7 @@ exports.isNotResumable = isNotResumable;
|
|
|
29
29
|
*
|
|
30
30
|
* Base class with the common logic to resume an in progress opeation
|
|
31
31
|
*/
|
|
32
|
-
class ResumeCommand extends
|
|
32
|
+
class ResumeCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
33
33
|
async init() {
|
|
34
34
|
await super.init();
|
|
35
35
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -38,48 +38,20 @@ class ResumeCommand extends sf_plugins_core_1.SfCommand {
|
|
|
38
38
|
baseFlags: super.ctor.baseFlags,
|
|
39
39
|
}); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
40
40
|
this.flags = flags;
|
|
41
|
-
this.
|
|
41
|
+
this.setOutputService(new outputService_1.OutputServiceFactory().forResume(this.flags, this.operationType, this.flags['devops-center-username'].getConnection()));
|
|
42
42
|
}
|
|
43
43
|
async resumeOperation() {
|
|
44
44
|
const asyncJobId = this.flags['use-most-recent']
|
|
45
45
|
? (await deployPipelineCache_1.DeployPipelineCache.create()).getLatestKeyOrThrow()
|
|
46
46
|
: this.flags['job-id'];
|
|
47
47
|
// get the latest state of the async job and validate that it's resumable
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
this.targetOrg = this.flags['devops-center-username'];
|
|
49
|
+
const asyncJob = await (0, common_1.fetchAsyncOperationResult)(this.targetOrg.getConnection(), asyncJobId);
|
|
50
50
|
if (asyncJob.sf_devops__Status__c && isNotResumable(asyncJob.sf_devops__Status__c)) {
|
|
51
51
|
throw messages.createError('error.JobNotResumable', [asyncJobId, asyncJob.sf_devops__Status__c]);
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
this.outputService.printOpSummary();
|
|
56
|
-
this.outputService.printAorId();
|
|
57
|
-
const streamer = (0, common_1.getAsyncOperationStreamer)(doceOrg, this.flags.wait, asyncJobId, this.outputService);
|
|
58
|
-
await streamer.monitor();
|
|
59
|
-
// get final state of the async job
|
|
60
|
-
asyncJob = await (0, common_1.fetchAsyncOperationResult)(doceOrg.getConnection(), asyncJobId);
|
|
61
|
-
return {
|
|
62
|
-
jobId: asyncJobId,
|
|
63
|
-
status: asyncJob.sf_devops__Status__c,
|
|
64
|
-
message: asyncJob.sf_devops__Message__c,
|
|
65
|
-
errorDetails: asyncJob.sf_devops__Error_Details__c,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Default function for catching commands errors.
|
|
70
|
-
*
|
|
71
|
-
* @param error
|
|
72
|
-
* @returns
|
|
73
|
-
*/
|
|
74
|
-
catch(error) {
|
|
75
|
-
if (error.name?.includes('GenericTimeoutError')) {
|
|
76
|
-
const err = messages.createError('error.ClientTimeout', [
|
|
77
|
-
this.config.bin,
|
|
78
|
-
this.id?.split(':').slice(0, -1).join(' '),
|
|
79
|
-
]);
|
|
80
|
-
return super.catch({ ...error, name: err.name, message: err.message, code: err.code });
|
|
81
|
-
}
|
|
82
|
-
return super.catch(error);
|
|
53
|
+
this.setAsyncOperationId(asyncJobId);
|
|
54
|
+
return this.monitorOperation(false, this.flags.wait);
|
|
83
55
|
}
|
|
84
56
|
}
|
|
85
57
|
exports.ResumeCommand = ResumeCommand;
|
|
@@ -88,6 +60,8 @@ ResumeCommand.baseFlags = {
|
|
|
88
60
|
'devops-center-username': (0, flags_1.requiredDoceOrgFlag)(),
|
|
89
61
|
'job-id': flags_1.jobId,
|
|
90
62
|
'use-most-recent': flags_1.useMostRecent,
|
|
63
|
+
concise: flags_1.concise,
|
|
64
|
+
verbose: flags_1.verbose,
|
|
91
65
|
wait: flags_1.wait,
|
|
92
66
|
};
|
|
93
67
|
//# sourceMappingURL=abstractResume.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractResume.js","sourceRoot":"","sources":["../../../src/common/base/abstractResume.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"abstractResume.js","sourceRoot":"","sources":["../../../src/common/base/abstractResume.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,2CAAiD;AAGjD,yCAKsB;AACtB,oDAA6G;AAC7G,kEAA+D;AAC/D,sDAA0D;AAC1D,qEAAwD;AAExD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,cAAc,CAAC,CAAC;AAE3F;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,MAA4B;IACzD,OAAO,CAAC,6BAAoB,CAAC,SAAS,EAAE,6BAAoB,CAAC,KAAK,EAAE,6BAAoB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrH,CAAC;AAFD,wCAEC;AAMD;;;GAGG;AAEH,MAAsB,aA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;QACrC,OAAO,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;;AA9CH,sCA+CC;AA9CC,+EAA+E;AACjE,uBAAS,GAAG;IACxB,wBAAwB,EAAE,IAAA,2BAAmB,GAAE;IAC/C,QAAQ,EAAE,aAAK;IACf,iBAAiB,EAAE,qBAAa;IAChC,OAAO,EAAP,eAAO;IACP,OAAO,EAAP,eAAO;IACP,IAAI,EAAJ,YAAI;CACL,CAAC"}
|
|
@@ -5,5 +5,6 @@ export declare const HTTP_CONFLICT_CODE = "CONFLICT";
|
|
|
5
5
|
export declare enum AsyncOperationType {
|
|
6
6
|
AD_HOC_PROMOTE = "AD_HOC_PROMOTE",
|
|
7
7
|
VERSIONED_PROMOTE = "VERSIONED_PROMOTE",
|
|
8
|
-
SOUP_PROMOTE = "SOUP_PROMOTE"
|
|
8
|
+
SOUP_PROMOTE = "SOUP_PROMOTE",
|
|
9
|
+
CHECK_DEPLOY = "CHECK_DEPLOY"
|
|
9
10
|
}
|
package/lib/common/constants.js
CHANGED
|
@@ -16,5 +16,6 @@ var AsyncOperationType;
|
|
|
16
16
|
AsyncOperationType["AD_HOC_PROMOTE"] = "AD_HOC_PROMOTE";
|
|
17
17
|
AsyncOperationType["VERSIONED_PROMOTE"] = "VERSIONED_PROMOTE";
|
|
18
18
|
AsyncOperationType["SOUP_PROMOTE"] = "SOUP_PROMOTE";
|
|
19
|
+
AsyncOperationType["CHECK_DEPLOY"] = "CHECK_DEPLOY";
|
|
19
20
|
})(AsyncOperationType = exports.AsyncOperationType || (exports.AsyncOperationType = {}));
|
|
20
21
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,mBAAmB,GAAG,2CAA2C,CAAC;AAClE,QAAA,qBAAqB,GAAG,mDAAmD,CAAC;AAC5E,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAC7C,IAAY,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,QAAQ,GAAG,UAAU,CAAC;AACtB,QAAA,mBAAmB,GAAG,2CAA2C,CAAC;AAClE,QAAA,qBAAqB,GAAG,mDAAmD,CAAC;AAC5E,QAAA,kBAAkB,GAAG,UAAU,CAAC;AAC7C,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,uDAAiC,CAAA;IACjC,6DAAuC,CAAA;IACvC,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;AAC/B,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B"}
|
package/lib/common/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ApiError, AsyncOperationResult, AsyncOperationStatus, DeploymentResult, PipelineStage, PromoteOptions, PromotePipelineResult, TestLevel, DeployComponent, } from './types';
|
|
1
|
+
export { ApiError, ApiPromoteResponse, AsyncOperationResult, AsyncOperationResultJson, AsyncOperationStatus, DeploymentResult, PipelineStage, PromoteOptions, PromotePipelineResult, TestLevel, DeployComponent, } from './types';
|
|
2
2
|
export { fetchAndValidatePipelineStage, fetchAsyncOperationResult, getAsyncOperationStreamer, validateTestFlags, } from './utils';
|
package/lib/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,iCAYiB;AAPf,6GAAA,oBAAoB,OAAA;AAKpB,kGAAA,SAAS,OAAA;AAGX,iCAKiB;AAJf,sHAAA,6BAA6B,OAAA;AAC7B,kHAAA,yBAAyB,OAAA;AACzB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA"}
|
|
@@ -20,5 +20,6 @@ exports.DeployComponentsTable = {
|
|
|
20
20
|
sf_devops__File_Path__c: { header: tableElements.getMessage('deployComponent.path.column') },
|
|
21
21
|
},
|
|
22
22
|
title: tableElements.getMessage('deployComponent.table.title'),
|
|
23
|
+
validateDeployTitle: tableElements.getMessage('deployComponent.table.validateDeployTitle'),
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=outputColumns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputColumns.js","sourceRoot":"","sources":["../../src/common/outputColumns.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA4C;AAE5C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,aAAa,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,+BAA+B,CAAC,CAAC;AAEpG,QAAA,qBAAqB,GAAG;IACnC,OAAO,EAAE;QACP,qCAAqC;QACrC,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,kCAAkC,CAAC,EAAE;QACjG,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE;QACzE,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE;QACzE,qCAAqC;QACrC,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE;KAC7F;IACD,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"outputColumns.js","sourceRoot":"","sources":["../../src/common/outputColumns.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA4C;AAE5C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,aAAa,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,+BAA+B,CAAC,CAAC;AAEpG,QAAA,qBAAqB,GAAG;IACnC,OAAO,EAAE;QACP,qCAAqC;QACrC,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,kCAAkC,CAAC,EAAE;QACjG,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE;QACzE,IAAI,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE;QACzE,qCAAqC;QACrC,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE;KAC7F;IACD,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,6BAA6B,CAAC;IAC9D,mBAAmB,EAAE,aAAa,CAAC,UAAU,CAAC,2CAA2C,CAAC;CAC3F,CAAC"}
|
|
@@ -25,14 +25,20 @@ class AbstractAorOutputService extends outputService_1.AbstractOutputService {
|
|
|
25
25
|
this.aorId = aorId;
|
|
26
26
|
}
|
|
27
27
|
printAorStatus(aor) {
|
|
28
|
-
if (aor.sf_devops__Status__c ===
|
|
29
|
-
console.log(aor.sf_devops__Message__c);
|
|
30
|
-
}
|
|
31
|
-
else if (aor.sf_devops__Status__c === types_1.AsyncOperationStatus.Completed) {
|
|
28
|
+
if (aor.sf_devops__Status__c === types_1.AsyncOperationStatus.Completed) {
|
|
32
29
|
console.log((0, chalk_1.green)(aor.sf_devops__Message__c));
|
|
33
30
|
}
|
|
34
|
-
else if (aor.sf_devops__Status__c === types_1.AsyncOperationStatus.Error
|
|
35
|
-
|
|
31
|
+
else if (aor.sf_devops__Status__c === types_1.AsyncOperationStatus.Error) {
|
|
32
|
+
if (aor.sf_devops__Error_Details__c) {
|
|
33
|
+
console.log((0, chalk_1.red)(output.getMessage('output.aor-error-status', [aor.sf_devops__Message__c, aor.sf_devops__Error_Details__c])));
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
console.log((0, chalk_1.red)(aor.sf_devops__Message__c));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// aor.sf_devops__Status__c == undefined || AsyncOperationStatus.InProgress
|
|
41
|
+
console.log(aor.sf_devops__Message__c);
|
|
36
42
|
}
|
|
37
43
|
this.status = aor.sf_devops__Status__c;
|
|
38
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aorOutputService.js","sourceRoot":"","sources":["../../../src/common/outputService/aorOutputService.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uDAAuD;AAEvD,2CAA4C;AAC5C,iCAAmC;AACnC,oCAAsE;AACtE,mDAAoF;AAEpF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,eAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,sBAAsB,CAAC,CAAC;AAiCjG;;;;GAIG;AACH,MAAsB,wBACpB,SAAQ,qCAAwB;IAMhC,YAAmB,KAAQ,EAAE,KAAa;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,cAAc,CAAC,GAAyB;QAC7C,IAAI,GAAG,CAAC,oBAAoB,KAAK,
|
|
1
|
+
{"version":3,"file":"aorOutputService.js","sourceRoot":"","sources":["../../../src/common/outputService/aorOutputService.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uDAAuD;AAEvD,2CAA4C;AAC5C,iCAAmC;AACnC,oCAAsE;AACtE,mDAAoF;AAEpF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,e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AAC;CAGF;AA9CD,4DA8CC"}
|
|
@@ -8,5 +8,5 @@ import { AbstractPromoteOutputService } from './promoteOutputService';
|
|
|
8
8
|
* @author JuanStenghele-sf
|
|
9
9
|
*/
|
|
10
10
|
export declare class DeployCommandOutputService extends AbstractPromoteOutputService {
|
|
11
|
-
constructor(flags: Flags<typeof SfCommand
|
|
11
|
+
constructor(flags: Partial<Flags<typeof SfCommand>>, con: Connection, branchName?: string);
|
|
12
12
|
}
|
|
@@ -15,10 +15,10 @@ const promoteOutputService_1 = require("./promoteOutputService");
|
|
|
15
15
|
* @author JuanStenghele-sf
|
|
16
16
|
*/
|
|
17
17
|
class DeployCommandOutputService extends promoteOutputService_1.AbstractPromoteOutputService {
|
|
18
|
-
constructor(flags, con) {
|
|
18
|
+
constructor(flags, con, branchName) {
|
|
19
19
|
super({
|
|
20
20
|
async: flags['async'],
|
|
21
|
-
branch: flags['branch-name'],
|
|
21
|
+
branch: branchName ? branchName : flags['branch-name'],
|
|
22
22
|
concise: flags['concise'],
|
|
23
23
|
verbose: flags['verbose'],
|
|
24
24
|
}, new deploySummaryBuilder_1.DeploySummaryBuilder(con), con);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployCommandOutputService.js","sourceRoot":"","sources":["../../../src/common/outputService/deployCommandOutputService.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAOH,iEAA8D;AAC9D,iEAAsE;AAEtE;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,mDAA4B;IAC1E,YAAmB,
|
|
1
|
+
{"version":3,"file":"deployCommandOutputService.js","sourceRoot":"","sources":["../../../src/common/outputService/deployCommandOutputService.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAOH,iEAA8D;AAC9D,iEAAsE;AAEtE;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,mDAA4B;IAC1E,YAAmB,KAAuC,EAAE,GAAe,EAAE,UAAmB;QAC9F,KAAK,CACH;YACE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACrB,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAE,KAAK,CAAC,aAAa,CAAY;YAClE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;YACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;SAC1B,EACD,IAAI,2CAAoB,CAAC,GAAG,CAAC,EAC7B,GAAG,CACJ,CAAC;IACJ,CAAC;CACF;AAbD,gEAaC"}
|
|
@@ -30,3 +30,15 @@ export declare abstract class DeploySummaryOutputService<T extends OutputFlags>
|
|
|
30
30
|
*/
|
|
31
31
|
protected abstract printSummary(): void;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* This method gets info from the Pipeline to write the summaries (soup, versioned, validate-deploy)
|
|
35
|
+
*
|
|
36
|
+
* @param con Conenction used to query
|
|
37
|
+
* @param environmentId
|
|
38
|
+
* @returns PipelineInfo
|
|
39
|
+
*/
|
|
40
|
+
export declare function getPipelineStageInfo(con: Connection, environmentId: string): Promise<PipelineStageInfo>;
|
|
41
|
+
export type PipelineStageInfo = {
|
|
42
|
+
stageName: string;
|
|
43
|
+
environmentName: string;
|
|
44
|
+
};
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.DeploySummaryOutputService = exports.DeploySummaryBuilder = void 0;
|
|
9
|
+
exports.getPipelineStageInfo = exports.DeploySummaryOutputService = exports.DeploySummaryBuilder = void 0;
|
|
10
10
|
/* eslint-disable no-console, @typescript-eslint/no-non-null-assertion */
|
|
11
11
|
const core_1 = require("@salesforce/core");
|
|
12
12
|
const constants_1 = require("../constants");
|
|
13
13
|
const deployProgressSummarySelector_1 = require("../selectors/deployProgressSummarySelector");
|
|
14
14
|
const environmentSelector_1 = require("../selectors/environmentSelector");
|
|
15
15
|
const workItemSelector_1 = require("../selectors/workItemSelector");
|
|
16
|
+
const validateDeploySelector_1 = require("../selectors/validateDeploySelector");
|
|
16
17
|
const outputService_1 = require("./outputService");
|
|
17
18
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
18
19
|
const output = core_1.Messages.loadMessages('@salesforce/plugin-devops-center', 'deploy.output');
|
|
@@ -38,6 +39,10 @@ class DeploySummaryBuilder {
|
|
|
38
39
|
return new VersionedDeploySummaryOutputService(queryResp.sf_devops__Change_Bundle_Installs__r.records, this.con, branch, flags);
|
|
39
40
|
case constants_1.AsyncOperationType.SOUP_PROMOTE:
|
|
40
41
|
return new SoupDeploySummaryOutputService(queryResp.sf_devops__Change_Bundle_Installs__r.records, queryResp.sf_devops__Work_Items__r.records, this.con, branch, flags);
|
|
42
|
+
case constants_1.AsyncOperationType.CHECK_DEPLOY: {
|
|
43
|
+
const response = await (0, validateDeploySelector_1.selectValidateDeployAORSummaryDataById)(this.con, aorId);
|
|
44
|
+
return new ValidateVersionedDeploySummaryOutputService(response, this.con, branch, flags);
|
|
45
|
+
}
|
|
41
46
|
default:
|
|
42
47
|
break;
|
|
43
48
|
}
|
|
@@ -59,7 +64,6 @@ class DeploySummaryOutputService extends outputService_1.AbstractOutputService {
|
|
|
59
64
|
this.printSummary();
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
|
-
// eslint-disable-next-line class-methods-use-this
|
|
63
67
|
printConciseSummary() {
|
|
64
68
|
console.log(output.getMessage('output.concise.summary', [this.stageName, this.branch, this.environmentName]));
|
|
65
69
|
}
|
|
@@ -109,9 +113,9 @@ class VersionedOrSoupSummaryOutputService extends DeploySummaryOutputService {
|
|
|
109
113
|
async buildCommonSummary() {
|
|
110
114
|
// We get the stage name and the org url
|
|
111
115
|
const envId = this.changeBundleInstalls[this.changeBundleInstalls.length - 1].sf_devops__Environment__r.Id;
|
|
112
|
-
const
|
|
113
|
-
this.stageName =
|
|
114
|
-
this.environmentName =
|
|
116
|
+
const pipelineStageInfo = await getPipelineStageInfo(this.con, envId);
|
|
117
|
+
this.stageName = pipelineStageInfo.stageName;
|
|
118
|
+
this.environmentName = pipelineStageInfo.environmentName;
|
|
115
119
|
}
|
|
116
120
|
printSummary() {
|
|
117
121
|
const bundlesSummary = [];
|
|
@@ -180,4 +184,54 @@ class SoupDeploySummaryOutputService extends VersionedOrSoupSummaryOutputService
|
|
|
180
184
|
this.workItems = workItems;
|
|
181
185
|
}
|
|
182
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Service class used to print the operation summary of an validate-deploy
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
class ValidateVersionedDeploySummaryOutputService extends DeploySummaryOutputService {
|
|
192
|
+
constructor(changeBundleInstalls, con, branch, flags) {
|
|
193
|
+
super(con, branch, flags);
|
|
194
|
+
this.changeBundles = [];
|
|
195
|
+
this.changeBundleInstalls = changeBundleInstalls;
|
|
196
|
+
}
|
|
197
|
+
async buildSummary() {
|
|
198
|
+
// We get the stage name and the org url
|
|
199
|
+
const envId = this.changeBundleInstalls[this.changeBundleInstalls.length - 1].sf_devops__Environment__r.Id;
|
|
200
|
+
const pipelineStageInfo = await getPipelineStageInfo(this.con, envId);
|
|
201
|
+
this.environmentName = pipelineStageInfo.environmentName;
|
|
202
|
+
const changeBundles = new Set();
|
|
203
|
+
for (const changeBundleInstall of this.changeBundleInstalls) {
|
|
204
|
+
const changeBundle = changeBundleInstall.sf_devops__Change_Bundle__r;
|
|
205
|
+
changeBundles.add(changeBundle.sf_devops__Version_Name__c);
|
|
206
|
+
}
|
|
207
|
+
this.changeBundles = Array.from(changeBundles);
|
|
208
|
+
}
|
|
209
|
+
printSummary() {
|
|
210
|
+
const bundlesLabel = this.changeBundles.length === 1 ? output.getMessage('output.bundle') : output.getMessage('output.bundles');
|
|
211
|
+
console.log(output.getMessage('output.validate-deploy-summary', [
|
|
212
|
+
bundlesLabel,
|
|
213
|
+
this.changeBundles.join('; '),
|
|
214
|
+
this.environmentName,
|
|
215
|
+
]));
|
|
216
|
+
}
|
|
217
|
+
printConciseSummary() {
|
|
218
|
+
console.log(output.getMessage('output.concise.validate-deploy-summary', [this.branch, this.environmentName]));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* This method gets info from the Pipeline to write the summaries (soup, versioned, validate-deploy)
|
|
223
|
+
*
|
|
224
|
+
* @param con Conenction used to query
|
|
225
|
+
* @param environmentId
|
|
226
|
+
* @returns PipelineInfo
|
|
227
|
+
*/
|
|
228
|
+
async function getPipelineStageInfo(con, environmentId) {
|
|
229
|
+
const envQueryResp = await (0, environmentSelector_1.selectPipelineStageByEnvironment)(con, environmentId);
|
|
230
|
+
const pipelineStageInfo = {
|
|
231
|
+
stageName: envQueryResp.sf_devops__Pipeline_Stages__r.records[0].Name,
|
|
232
|
+
environmentName: envQueryResp.Name,
|
|
233
|
+
};
|
|
234
|
+
return pipelineStageInfo;
|
|
235
|
+
}
|
|
236
|
+
exports.getPipelineStageInfo = getPipelineStageInfo;
|
|
183
237
|
//# sourceMappingURL=deploySummaryBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploySummaryBuilder.js","sourceRoot":"","sources":["../../../src/common/outputService/deploySummaryBuilder.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yEAAyE;AAEzE,2CAAwD;AACxD,4CAAkD;AAClD,8FAAsH;AACtH,0EAAoG;AACpG,oEAAqG;
|
|
1
|
+
{"version":3,"file":"deploySummaryBuilder.js","sourceRoot":"","sources":["../../../src/common/outputService/deploySummaryBuilder.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yEAAyE;AAEzE,2CAAwD;AACxD,4CAAkD;AAClD,8FAAsH;AACtH,0EAAoG;AACpG,oEAAqG;AACrG,gFAA6F;AAE7F,mDAAoF;AAEpF,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,eAAQ,CA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,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAChH,CAAC;CACF;AAED;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CAAC,GAAe,EAAE,aAAqB;IAC/E,MAAM,YAAY,GAAmB,MAAM,IAAA,sDAAgC,EAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IAEhG,MAAM,iBAAiB,GAAsB;QAC3C,SAAS,EAAE,YAAY,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;QACrE,eAAe,EAAE,YAAY,CAAC,IAAI;KACnC,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AATD,oDASC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Connection } from '@salesforce/core';
|
|
2
2
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import
|
|
3
|
+
import { Flags as PromoteFlags } from '../base/abstractPromote';
|
|
4
|
+
import { Flags as ReportFlags } from '../base/abstractReportOnPromote';
|
|
5
|
+
import { Flags as ResumeFlags } from '../base/abstractResume';
|
|
6
|
+
import { Flags as QuickPromoteFlags } from '../base/abstractQuick';
|
|
4
7
|
import { DeploymentResult } from '../types';
|
|
5
|
-
import { Flags } from '../base/abstractReportOnPromote';
|
|
6
8
|
import { DeployCommandOutputService } from './deployCommandOutputService';
|
|
7
9
|
import { PromoteReportOutputService } from './reportOutputService';
|
|
8
10
|
import { ResumeCommandOutputService } from './resumeCommandOutputService';
|
|
@@ -15,13 +17,17 @@ export declare class OutputServiceFactory {
|
|
|
15
17
|
/**
|
|
16
18
|
* Create a service to print the deployment info.
|
|
17
19
|
*/
|
|
18
|
-
forDeployment(flags:
|
|
20
|
+
forDeployment(flags: Partial<PromoteFlags<typeof SfCommand>>, con: Connection): DeployCommandOutputService;
|
|
21
|
+
/**
|
|
22
|
+
* Create a service to print the quick deployment info.
|
|
23
|
+
*/
|
|
24
|
+
forQuickDeployment(flags: Partial<QuickPromoteFlags<typeof SfCommand>>, con: Connection, branchName: string): DeployCommandOutputService;
|
|
19
25
|
/**
|
|
20
26
|
* Create a service to print the resume info.
|
|
21
27
|
*/
|
|
22
|
-
forResume(operationType: string): ResumeCommandOutputService;
|
|
28
|
+
forResume(flags: ResumeFlags<typeof SfCommand>, operationType: string, con: Connection): ResumeCommandOutputService;
|
|
23
29
|
/**
|
|
24
30
|
* Create a service to print the report info.
|
|
25
31
|
*/
|
|
26
|
-
forPromotionReport(flags:
|
|
32
|
+
forPromotionReport(flags: ReportFlags<typeof SfCommand>, operationResult: DeploymentResult, operationName: string): PromoteReportOutputService;
|
|
27
33
|
}
|