@salesforce/plugin-deploy-retrieve 2.2.17 → 3.1.0
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 +17 -19
- package/lib/commands/project/convert/mdapi.js.map +1 -1
- package/lib/commands/project/convert/source.js.map +1 -1
- package/lib/commands/project/delete/source.js +1 -1
- package/lib/commands/project/delete/source.js.map +1 -1
- package/lib/commands/project/delete/tracking.js +1 -1
- package/lib/commands/project/delete/tracking.js.map +1 -1
- package/lib/commands/project/deploy/cancel.d.ts +1 -1
- package/lib/commands/project/deploy/cancel.js.map +1 -1
- package/lib/commands/project/deploy/preview.js.map +1 -1
- package/lib/commands/project/deploy/quick.d.ts +1 -1
- package/lib/commands/project/deploy/quick.js.map +1 -1
- package/lib/commands/project/deploy/start.d.ts +1 -1
- package/lib/commands/project/deploy/start.js.map +1 -1
- package/lib/commands/project/list/ignored.js.map +1 -1
- package/lib/commands/project/reset/tracking.js +2 -1
- package/lib/commands/project/reset/tracking.js.map +1 -1
- package/lib/commands/project/retrieve/preview.js.map +1 -1
- package/lib/commands/project/retrieve/start.d.ts +1 -1
- package/lib/commands/project/retrieve/start.js.map +1 -1
- package/lib/configMeta.js.map +1 -1
- package/lib/formatters/asyncDeployCancelResultFormatter.d.ts +0 -2
- package/lib/formatters/asyncDeployCancelResultFormatter.js +2 -2
- package/lib/formatters/asyncDeployCancelResultFormatter.js.map +1 -1
- package/lib/formatters/asyncDeployResultFormatter.d.ts +0 -2
- package/lib/formatters/asyncDeployResultFormatter.js +2 -2
- package/lib/formatters/asyncDeployResultFormatter.js.map +1 -1
- package/lib/utils/coverage.d.ts +1 -1
- package/lib/utils/flags.d.ts +0 -6
- package/lib/utils/flags.js +1 -1
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/previewOutput.d.ts +0 -1
- package/lib/utils/previewOutput.js +1 -1
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/types.d.ts +1 -12
- package/lib/utils/types.js.map +1 -1
- package/oclif.lock +142 -88
- package/oclif.manifest.json +2 -61
- package/package.json +6 -9
- package/lib/commands/deploy.d.ts +0 -31
- package/lib/commands/deploy.js +0 -191
- package/lib/commands/deploy.js.map +0 -1
- package/lib/hooks/deploy.d.ts +0 -4
- package/lib/hooks/deploy.js +0 -15
- package/lib/hooks/deploy.js.map +0 -1
- package/lib/utils/metadataDeployer.d.ts +0 -30
- package/lib/utils/metadataDeployer.js +0 -220
- package/lib/utils/metadataDeployer.js.map +0 -1
- package/messages/deploy.md +0 -90
- package/schemas/hooks/sf-deploy.json +0 -129
package/lib/commands/deploy.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
/* eslint-disable class-methods-use-this */
|
|
8
|
-
import { EOL } from 'node:os';
|
|
9
|
-
import { writeFile, readFile } from 'node:fs/promises';
|
|
10
|
-
import { existsSync } from 'node:fs';
|
|
11
|
-
import { exec } from 'node:child_process';
|
|
12
|
-
import { Messages } from '@salesforce/core';
|
|
13
|
-
import { Env, parseJsonMap } from '@salesforce/kit';
|
|
14
|
-
import { generateTableChoices, Prompter, SfCommand, SfHook, Flags, } from '@salesforce/sf-plugins-core';
|
|
15
|
-
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
16
|
-
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy');
|
|
17
|
-
export const DEPLOY_OPTIONS_FILE = 'deploy-options.json';
|
|
18
|
-
export default class Deploy extends SfCommand {
|
|
19
|
-
static summary = messages.getMessage('summary');
|
|
20
|
-
static description = messages.getMessage('description');
|
|
21
|
-
static examples = messages.getMessages('examples');
|
|
22
|
-
static enableJsonFlag = false;
|
|
23
|
-
static state = 'deprecated';
|
|
24
|
-
static hidden = true;
|
|
25
|
-
static deprecationOptions = {
|
|
26
|
-
version: '59.0',
|
|
27
|
-
message: messages.getMessage('deprecation'),
|
|
28
|
-
};
|
|
29
|
-
static flags = {
|
|
30
|
-
interactive: Flags.boolean({
|
|
31
|
-
summary: messages.getMessage('flags.interactive.summary'),
|
|
32
|
-
}),
|
|
33
|
-
};
|
|
34
|
-
async run() {
|
|
35
|
-
process.setMaxListeners(new Env().getNumber('SF_MAX_EVENT_LISTENERS') ?? 1000);
|
|
36
|
-
const { flags } = await this.parse(Deploy);
|
|
37
|
-
flags.interactive = await this.isInteractive(flags.interactive);
|
|
38
|
-
const options = await this.readOptions();
|
|
39
|
-
this.log(messages.getMessage('AnalyzingProject'));
|
|
40
|
-
if (!flags.interactive) {
|
|
41
|
-
this.log(messages.getMessage('UsingOptionsFromFile', [DEPLOY_OPTIONS_FILE]));
|
|
42
|
-
}
|
|
43
|
-
const hookResults = await SfHook.run(this.config, 'sf:deploy', options);
|
|
44
|
-
this.checkForHookFailures(hookResults);
|
|
45
|
-
let deployers = hookResults.successes.flatMap((s) => s.result);
|
|
46
|
-
if (deployers.length === 0) {
|
|
47
|
-
this.log(messages.getMessage('FoundNothingToDeploy'));
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
if (flags.interactive) {
|
|
51
|
-
deployers = await this.selectDeployers(deployers);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
deployers = deployers.filter((d) => !!options[d.getName()]);
|
|
55
|
-
}
|
|
56
|
-
if (deployers.length === 0) {
|
|
57
|
-
this.log(messages.getMessage('NothingSelectedToDeploy'));
|
|
58
|
-
}
|
|
59
|
-
const deployOptions = {};
|
|
60
|
-
for (const deployer of deployers) {
|
|
61
|
-
const opts = options[deployer.getName()] ?? {};
|
|
62
|
-
// setup must be done sequentially
|
|
63
|
-
// eslint-disable-next-line no-await-in-loop
|
|
64
|
-
deployOptions[deployer.getName()] = await deployer.setup(flags, opts);
|
|
65
|
-
}
|
|
66
|
-
if (flags.interactive && (await this.askToSave())) {
|
|
67
|
-
await writeJson(DEPLOY_OPTIONS_FILE, deployOptions);
|
|
68
|
-
this.log();
|
|
69
|
-
this.log(messages.getMessage('DeployOptionsSavedToFile', [DEPLOY_OPTIONS_FILE]));
|
|
70
|
-
if (await this.shouldCommit()) {
|
|
71
|
-
await this.commit();
|
|
72
|
-
this.log(messages.getMessage('DeployOptionsIncludedInGitIgnore', [DEPLOY_OPTIONS_FILE]));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const deployResults = [];
|
|
76
|
-
for (const deployer of deployers) {
|
|
77
|
-
// deployments must be done sequentially?
|
|
78
|
-
// eslint-disable-next-line no-await-in-loop
|
|
79
|
-
deployResults.push([deployer, await deployer.deploy()]);
|
|
80
|
-
}
|
|
81
|
-
if (deployResults.some(([, result]) => !!result && result.exitCode !== 0)) {
|
|
82
|
-
process.exitCode = 1;
|
|
83
|
-
this.warn(messages.getMessage('DeployersHaveNonZeroExitCode'));
|
|
84
|
-
deployResults
|
|
85
|
-
.filter(([, result]) => !!result && result.exitCode !== 0)
|
|
86
|
-
.forEach(([deployer, result]) => {
|
|
87
|
-
this.log(messages.getMessage('DeployerExitCode', [deployer.getName(), result ? result.exitCode : 'unknown']));
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* If the deploy file exists, we do not want the command to be interactive. But if the file
|
|
94
|
-
* does not exist then we want to force the command to be interactive.
|
|
95
|
-
*/
|
|
96
|
-
// this used to be async when it was using fs-extra. Presered public api
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
98
|
-
async isInteractive(interactive) {
|
|
99
|
-
if (interactive)
|
|
100
|
-
return true;
|
|
101
|
-
const deployFileExists = existsSync(DEPLOY_OPTIONS_FILE);
|
|
102
|
-
return deployFileExists ? false : true;
|
|
103
|
-
}
|
|
104
|
-
async readOptions() {
|
|
105
|
-
if (existsSync(DEPLOY_OPTIONS_FILE)) {
|
|
106
|
-
return parseJsonMap(await readFile(DEPLOY_OPTIONS_FILE, 'utf8'));
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
return {};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
async commit() {
|
|
113
|
-
const gitignore = await readFile('.gitignore', 'utf-8');
|
|
114
|
-
if (!gitignore.includes(DEPLOY_OPTIONS_FILE)) {
|
|
115
|
-
const addition = `${EOL}${EOL}# Deploy Options${EOL}${DEPLOY_OPTIONS_FILE}${EOL}`;
|
|
116
|
-
await writeFile('.gitignore', `${gitignore}${addition}`);
|
|
117
|
-
}
|
|
118
|
-
exec('git add .gitignore');
|
|
119
|
-
exec(`git commit -am "Add ${DEPLOY_OPTIONS_FILE} to .gitignore"`);
|
|
120
|
-
}
|
|
121
|
-
// this used to be async when it was using fs-extra. Presered public api
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
123
|
-
async shouldCommit() {
|
|
124
|
-
return existsSync('.git') && existsSync('functions');
|
|
125
|
-
}
|
|
126
|
-
async askToSave() {
|
|
127
|
-
const prompter = new Prompter();
|
|
128
|
-
const { save } = await prompter.prompt({
|
|
129
|
-
name: 'save',
|
|
130
|
-
message: 'Would you like to save these deploy options for future runs?',
|
|
131
|
-
type: 'confirm',
|
|
132
|
-
});
|
|
133
|
-
return save;
|
|
134
|
-
}
|
|
135
|
-
async selectDeployers(deployers) {
|
|
136
|
-
const deployables = deployers.reduce((x, y) => x.concat(y.deployables), []);
|
|
137
|
-
const columns = { name: 'APP OR PACKAGE', type: 'TYPE', path: 'PATH' };
|
|
138
|
-
const options = deployables.map((deployable) => ({
|
|
139
|
-
name: deployable.getName(),
|
|
140
|
-
type: deployable.getType(),
|
|
141
|
-
path: deployable.getPath(),
|
|
142
|
-
value: deployable,
|
|
143
|
-
}));
|
|
144
|
-
const prompter = new Prompter();
|
|
145
|
-
const responses = await prompter.prompt([
|
|
146
|
-
{
|
|
147
|
-
name: 'deployables',
|
|
148
|
-
message: 'Select apps and packages to deploy:',
|
|
149
|
-
type: 'checkbox',
|
|
150
|
-
choices: generateTableChoices(columns, options),
|
|
151
|
-
},
|
|
152
|
-
]);
|
|
153
|
-
const chosenDeployers = new Map();
|
|
154
|
-
for (const deployable of responses.deployables) {
|
|
155
|
-
const parent = deployable.getParent();
|
|
156
|
-
if (chosenDeployers.has(parent)) {
|
|
157
|
-
const existing = chosenDeployers.get(parent) ?? [];
|
|
158
|
-
chosenDeployers.set(parent, [...existing, deployable]);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
chosenDeployers.set(parent, [deployable]);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
const final = [];
|
|
165
|
-
for (const [parent, children] of Array.from(chosenDeployers.entries())) {
|
|
166
|
-
parent.selectDeployables(children);
|
|
167
|
-
final.push(parent);
|
|
168
|
-
}
|
|
169
|
-
return final;
|
|
170
|
-
}
|
|
171
|
-
checkForHookFailures(hookResults) {
|
|
172
|
-
if (hookResults.failures?.length) {
|
|
173
|
-
// display a table of the errors encountered; Plugin Name, Error Message
|
|
174
|
-
const columns = {
|
|
175
|
-
errorName: { header: 'Error Name' },
|
|
176
|
-
errorMessage: { header: 'Error Message' },
|
|
177
|
-
};
|
|
178
|
-
const failureData = hookResults.failures.map((failure) => ({
|
|
179
|
-
errorName: failure.error.name,
|
|
180
|
-
errorMessage: failure.error.message,
|
|
181
|
-
}));
|
|
182
|
-
this.styledHeader(messages.getMessage('error.initialization.title'));
|
|
183
|
-
this.table(failureData, columns, { 'no-truncate': true });
|
|
184
|
-
const err = messages.createError('error.initialization');
|
|
185
|
-
err.data = hookResults.failures;
|
|
186
|
-
throw err;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
export const writeJson = async (filename, data) => writeFile(filename, JSON.stringify(data, null, 2));
|
|
191
|
-
//# sourceMappingURL=deploy.js.map
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AC;QACZ,CAAC;IACH,CAAC;;AAGH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAE,QAAgB,EAAE,IAAsC,EAAiB,EAAE,CACzG,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
package/lib/hooks/deploy.d.ts
DELETED
package/lib/hooks/deploy.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import { SfProject } from '@salesforce/core';
|
|
8
|
-
import { MetadataDeployer } from '../utils/metadataDeployer.js';
|
|
9
|
-
const hook = async function () {
|
|
10
|
-
const project = await SfProject.resolve();
|
|
11
|
-
const packageDirectories = project.getPackageDirectories();
|
|
12
|
-
return [new MetadataDeployer(packageDirectories)];
|
|
13
|
-
};
|
|
14
|
-
export default hook;
|
|
15
|
-
//# sourceMappingURL=deploy.js.map
|
package/lib/hooks/deploy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/hooks/deploy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,MAAM,IAAI,GAAoC,KAAK;IACjD,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAC3D,OAAO,CAAC,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { NamedPackageDir } from '@salesforce/core';
|
|
2
|
-
import { Deployable, Deployer, DeployerResult } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { TestLevel } from './types.js';
|
|
4
|
-
export interface MetadataDeployOptions extends Deployer.Options {
|
|
5
|
-
testLevel?: TestLevel;
|
|
6
|
-
username?: string;
|
|
7
|
-
directories?: string[];
|
|
8
|
-
}
|
|
9
|
-
export declare class DeployablePackage extends Deployable {
|
|
10
|
-
pkg: NamedPackageDir;
|
|
11
|
-
private parent;
|
|
12
|
-
constructor(pkg: NamedPackageDir, parent: Deployer);
|
|
13
|
-
getName(): string;
|
|
14
|
-
getType(): string;
|
|
15
|
-
getPath(): string;
|
|
16
|
-
getParent(): Deployer;
|
|
17
|
-
}
|
|
18
|
-
export declare class MetadataDeployer extends Deployer {
|
|
19
|
-
private packages;
|
|
20
|
-
static NAME: string;
|
|
21
|
-
deployables: DeployablePackage[];
|
|
22
|
-
private testLevel;
|
|
23
|
-
private username;
|
|
24
|
-
constructor(packages: NamedPackageDir[]);
|
|
25
|
-
getName(): string;
|
|
26
|
-
setup(flags: Deployer.Flags, options: MetadataDeployOptions): Promise<MetadataDeployOptions>;
|
|
27
|
-
deploy<R extends DeployerResult>(): Promise<void | R>;
|
|
28
|
-
promptForUsername(): Promise<string>;
|
|
29
|
-
promptForTestLevel(): Promise<TestLevel>;
|
|
30
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* Licensed under the BSD 3-Clause license.
|
|
5
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
/* eslint-disable class-methods-use-this */
|
|
8
|
-
import { EOL } from 'node:os';
|
|
9
|
-
import chalk from 'chalk';
|
|
10
|
-
import { Duration } from '@salesforce/kit';
|
|
11
|
-
import { AuthInfo, ConfigAggregator, StateAggregator, Messages, OrgConfigProperties, Org, } from '@salesforce/core';
|
|
12
|
-
import { Deployable, Deployer, generateTableChoices } from '@salesforce/sf-plugins-core';
|
|
13
|
-
import { DeployResultFormatter } from '../formatters/deployResultFormatter.js';
|
|
14
|
-
import { TestLevel } from './types.js';
|
|
15
|
-
import { DeployProgress } from './progressBar.js';
|
|
16
|
-
import { determineExitCode, executeDeploy, resolveApi } from './deploy.js';
|
|
17
|
-
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
18
|
-
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy');
|
|
19
|
-
const compareOrgs = (a, b) => {
|
|
20
|
-
// scratch orgs before other orgs
|
|
21
|
-
if (a.isScratchOrg && !b.isScratchOrg) {
|
|
22
|
-
// all scratch orgs come before non-scratch orgs
|
|
23
|
-
return -1;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
// sort scratch orgs by timestamp - descending
|
|
27
|
-
if (a.isScratchOrg && b.isScratchOrg) {
|
|
28
|
-
const aTimestamp = new Date(a.timestamp);
|
|
29
|
-
const bTimestamp = new Date(b.timestamp);
|
|
30
|
-
return bTimestamp.getTime() - aTimestamp.getTime();
|
|
31
|
-
}
|
|
32
|
-
// dev hubs after scratch but before remaining orgs
|
|
33
|
-
if (a.isDevHub && !b.isScratchOrg && !b.isDevHub) {
|
|
34
|
-
return -1;
|
|
35
|
-
}
|
|
36
|
-
// not a scratch org and not a devhub means "other" sorts last
|
|
37
|
-
if (!a.isDevHub) {
|
|
38
|
-
return 1;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// orgs are equal by type - sort by name ascending
|
|
42
|
-
return a.username.localeCompare(b.username);
|
|
43
|
-
};
|
|
44
|
-
export class DeployablePackage extends Deployable {
|
|
45
|
-
pkg;
|
|
46
|
-
parent;
|
|
47
|
-
constructor(pkg, parent) {
|
|
48
|
-
super();
|
|
49
|
-
this.pkg = pkg;
|
|
50
|
-
this.parent = parent;
|
|
51
|
-
}
|
|
52
|
-
getName() {
|
|
53
|
-
return this.pkg.name;
|
|
54
|
-
}
|
|
55
|
-
getType() {
|
|
56
|
-
return 'Salesforce App';
|
|
57
|
-
}
|
|
58
|
-
getPath() {
|
|
59
|
-
return this.pkg.path;
|
|
60
|
-
}
|
|
61
|
-
getParent() {
|
|
62
|
-
return this.parent;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export class MetadataDeployer extends Deployer {
|
|
66
|
-
packages;
|
|
67
|
-
static NAME = 'Salesforce Apps';
|
|
68
|
-
testLevel = TestLevel.NoTestRun;
|
|
69
|
-
username;
|
|
70
|
-
constructor(packages) {
|
|
71
|
-
super();
|
|
72
|
-
this.packages = packages;
|
|
73
|
-
this.deployables = this.packages.map((pkg) => new DeployablePackage(pkg, this));
|
|
74
|
-
}
|
|
75
|
-
getName() {
|
|
76
|
-
return MetadataDeployer.NAME;
|
|
77
|
-
}
|
|
78
|
-
async setup(flags, options) {
|
|
79
|
-
if (flags.interactive) {
|
|
80
|
-
this.testLevel = await this.promptForTestLevel();
|
|
81
|
-
this.username = await this.promptForUsername();
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
if (options.directories?.length) {
|
|
85
|
-
const directories = options.directories || [];
|
|
86
|
-
const selected = this.deployables.filter((d) => directories.includes(d.getPath()));
|
|
87
|
-
this.selectDeployables(selected);
|
|
88
|
-
}
|
|
89
|
-
this.testLevel = options.testLevel ?? (await this.promptForTestLevel());
|
|
90
|
-
this.username = options.username ?? (await this.promptForUsername());
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
testLevel: this.testLevel,
|
|
94
|
-
username: this.username,
|
|
95
|
-
apps: this.deployables.map((d) => d.getPath()),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
async deploy() {
|
|
99
|
-
const directories = this.deployables.map((d) => d.pkg.fullPath);
|
|
100
|
-
const name = this.deployables.map((p) => chalk.cyan.bold(p.getPath())).join(', ');
|
|
101
|
-
const api = await resolveApi();
|
|
102
|
-
this.log(`${EOL}Deploying ${name} to ${this.username} using ${api} API`);
|
|
103
|
-
const { deploy } = await executeDeploy({
|
|
104
|
-
'target-org': this.username,
|
|
105
|
-
'source-dir': directories,
|
|
106
|
-
'test-level': this.testLevel,
|
|
107
|
-
api,
|
|
108
|
-
}, undefined, undefined, undefined, true);
|
|
109
|
-
new DeployProgress(deploy).start();
|
|
110
|
-
const result = await deploy.pollStatus(500, Duration.minutes(33).seconds);
|
|
111
|
-
const formatter = new DeployResultFormatter(result, {
|
|
112
|
-
'test-level': this.testLevel,
|
|
113
|
-
verbose: false,
|
|
114
|
-
concise: false,
|
|
115
|
-
'target-org': await Org.create({ aliasOrUsername: this.username }),
|
|
116
|
-
});
|
|
117
|
-
formatter.display();
|
|
118
|
-
const deployerResult = {
|
|
119
|
-
exitCode: determineExitCode(result),
|
|
120
|
-
};
|
|
121
|
-
return deployerResult;
|
|
122
|
-
}
|
|
123
|
-
async promptForUsername() {
|
|
124
|
-
const aliasOrUsername = ConfigAggregator.getValue(OrgConfigProperties.TARGET_ORG)?.value;
|
|
125
|
-
const stateAggregator = await StateAggregator.getInstance();
|
|
126
|
-
await stateAggregator.orgs.readAll();
|
|
127
|
-
const allAliases = stateAggregator.aliases.getAll();
|
|
128
|
-
let targetOrgAuth;
|
|
129
|
-
// make sure the "target-org" can be used in this deploy
|
|
130
|
-
if (aliasOrUsername) {
|
|
131
|
-
targetOrgAuth = (await AuthInfo.listAllAuthorizations((a) => (a.username === aliasOrUsername || a.aliases?.some((alias) => alias === aliasOrUsername)) ?? false)).find((a) => a);
|
|
132
|
-
if (targetOrgAuth) {
|
|
133
|
-
if (targetOrgAuth?.isExpired) {
|
|
134
|
-
const continueAnswer = await this.prompt([
|
|
135
|
-
{
|
|
136
|
-
name: 'continue',
|
|
137
|
-
type: 'confirm',
|
|
138
|
-
message: chalk.red(messages.getMessage('warning.TargetOrgIsExpired', [aliasOrUsername])),
|
|
139
|
-
},
|
|
140
|
-
]);
|
|
141
|
-
if (!continueAnswer.continue) {
|
|
142
|
-
throw messages.createError('error.UserTerminatedDeployForExpiredOrg');
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
return stateAggregator.aliases.resolveUsername(aliasOrUsername);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
if (!aliasOrUsername || targetOrgAuth?.isExpired) {
|
|
151
|
-
const promises = (await AuthInfo.listAllAuthorizations((orgAuth) => !orgAuth.error && orgAuth.isExpired !== true)).map(async (orgAuth) => {
|
|
152
|
-
const stat = await stateAggregator.orgs.stat(orgAuth.username);
|
|
153
|
-
const timestamp = stat ? new Date(stat.mtimeMs) : new Date();
|
|
154
|
-
return { ...orgAuth, timestamp };
|
|
155
|
-
});
|
|
156
|
-
const authorizations = await Promise.all(promises);
|
|
157
|
-
if (authorizations.length > 0) {
|
|
158
|
-
const newestAuths = authorizations.sort(compareOrgs);
|
|
159
|
-
const options = newestAuths.map((auth) => ({
|
|
160
|
-
name: auth.username,
|
|
161
|
-
aliases: Object.entries(allAliases)
|
|
162
|
-
.filter(([, usernameOrAlias]) => usernameOrAlias === auth.username)
|
|
163
|
-
.map(([alias]) => alias)
|
|
164
|
-
.join(', '),
|
|
165
|
-
isScratchOrg: auth.isScratchOrg ? 'Yes' : 'No',
|
|
166
|
-
value: auth.username,
|
|
167
|
-
}));
|
|
168
|
-
const columns = { name: 'Org', aliases: 'Aliases', isScratchOrg: 'Scratch Org' };
|
|
169
|
-
const { username } = await this.prompt([
|
|
170
|
-
{
|
|
171
|
-
name: 'username',
|
|
172
|
-
message: 'Select the org you want to deploy to:',
|
|
173
|
-
type: 'list',
|
|
174
|
-
choices: generateTableChoices(columns, options, false),
|
|
175
|
-
},
|
|
176
|
-
]);
|
|
177
|
-
if (targetOrgAuth?.isExpired) {
|
|
178
|
-
const setTargetOrg = await this.prompt([
|
|
179
|
-
{
|
|
180
|
-
name: 'save',
|
|
181
|
-
type: 'confirm',
|
|
182
|
-
message: messages.getMessage('save.as.default', [username]),
|
|
183
|
-
},
|
|
184
|
-
]);
|
|
185
|
-
if (setTargetOrg.save) {
|
|
186
|
-
const authInfo = await AuthInfo.create({ username });
|
|
187
|
-
await authInfo.setAsDefault({ org: true });
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return username;
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
throw messages.createError('errors.NoOrgsToSelect');
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
throw new Error('Unexpected: You should not have arrived here.');
|
|
197
|
-
}
|
|
198
|
-
async promptForTestLevel() {
|
|
199
|
-
const { testLevel } = await this.prompt([
|
|
200
|
-
{
|
|
201
|
-
name: 'testLevel',
|
|
202
|
-
message: 'Select the test level you would like to run:',
|
|
203
|
-
type: 'list',
|
|
204
|
-
loop: false,
|
|
205
|
-
pageSize: 4,
|
|
206
|
-
choices: [
|
|
207
|
-
{ name: "Don't run tests", value: TestLevel.NoTestRun, short: "Don't run tests" },
|
|
208
|
-
{ name: 'Run local tests', value: TestLevel.RunLocalTests, short: 'Run local tests' },
|
|
209
|
-
{
|
|
210
|
-
name: 'Run all tests in environment',
|
|
211
|
-
value: TestLevel.RunAllTestsInOrg,
|
|
212
|
-
short: 'Run all tests in environment',
|
|
213
|
-
},
|
|
214
|
-
],
|
|
215
|
-
},
|
|
216
|
-
]);
|
|
217
|
-
return testLevel;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=metadataDeployer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,2CAA2C;AAI3C,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,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A2B;YAChE;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,8CAA8C;gBACvD,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,KAAK;gBACX,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE;oBACP,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACjF,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,CAAC,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACrF;wBACE,IAAI,EAAE,8BAA8B;wBACpC,KAAK,EAAE,SAAS,CAAC,gBAAgB;wBACjC,KAAK,EAAE,8BAA8B;qBACtC;iBACF;aACF;SACF,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC"}
|
package/messages/deploy.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# summary
|
|
2
|
-
|
|
3
|
-
Deploy a project interactively to any Salesforce environment.
|
|
4
|
-
|
|
5
|
-
# description
|
|
6
|
-
|
|
7
|
-
This command must be run from within a project.
|
|
8
|
-
|
|
9
|
-
The command first analyzes your project, your active or logged-into environments, and local defaults to determine what to deploy and where to deploy it. The command then prompts you for information about this particular deployment and provides intelligent choices based on its analysis.
|
|
10
|
-
|
|
11
|
-
For example, if your local project contains a source directory with metadata files in source format, the command asks if you want to deploy that Salesforce app to an org. The command lists your connected orgs and asks which one you want to deploy to. The list of orgs starts with scratch orgs, ordered by expiration date with the most recently created one first, and then Dev Hub and production orgs ordered by name. If the command finds Apex tests, it asks if you want to run them and at which level.
|
|
12
|
-
|
|
13
|
-
The command stores your responses in the "deploy-options.json" file in your local project directory and uses them as defaults when you rerun the command. Specify --interactive to force the command to reprompt.
|
|
14
|
-
|
|
15
|
-
Use this command for quick and simple deploys. For more complicated deployments, use the environment-specific commands, such as "<%= config.bin %> project deploy start", that provide additional flags.
|
|
16
|
-
|
|
17
|
-
# examples
|
|
18
|
-
|
|
19
|
-
- Deploy a project and use stored values from a previous command run:
|
|
20
|
-
|
|
21
|
-
<%= config.bin %> <%= command.id %>
|
|
22
|
-
|
|
23
|
-
- Reprompt for all deployment inputs:
|
|
24
|
-
|
|
25
|
-
<%= config.bin %> <%= command.id %> --interactive
|
|
26
|
-
|
|
27
|
-
# flags.interactive.summary
|
|
28
|
-
|
|
29
|
-
Force the CLI to prompt for all deployment inputs.
|
|
30
|
-
|
|
31
|
-
# errors.NoOrgsToSelect
|
|
32
|
-
|
|
33
|
-
Can't find any active scratch orgs, Dev Hubs, or other orgs.
|
|
34
|
-
Either log into an org or create a scratch org, and then try again.
|
|
35
|
-
|
|
36
|
-
# error.initialization
|
|
37
|
-
|
|
38
|
-
One or more initialization steps failed.
|
|
39
|
-
|
|
40
|
-
# error.initialization.title
|
|
41
|
-
|
|
42
|
-
Initialization Failures. The following table describes each failure:
|
|
43
|
-
|
|
44
|
-
# error.UserTerminatedDeployForExpiredOrg
|
|
45
|
-
|
|
46
|
-
The target-org found in the configuration is expired. The user terminated the deploy.
|
|
47
|
-
|
|
48
|
-
# warning.TargetOrgIsExpired
|
|
49
|
-
|
|
50
|
-
The target-org, "%s", is expired. Do you want to pick another org?
|
|
51
|
-
|
|
52
|
-
# AnalyzingProject
|
|
53
|
-
|
|
54
|
-
Analyzing project
|
|
55
|
-
|
|
56
|
-
# UsingOptionsFromFile
|
|
57
|
-
|
|
58
|
-
Using options found in %s.
|
|
59
|
-
|
|
60
|
-
# FoundNothingToDeploy
|
|
61
|
-
|
|
62
|
-
Found nothing in the project to deploy.
|
|
63
|
-
|
|
64
|
-
# NothingSelectedToDeploy
|
|
65
|
-
|
|
66
|
-
Nothing was selected to deploy.
|
|
67
|
-
|
|
68
|
-
# DeployOptionsSavedToFile
|
|
69
|
-
|
|
70
|
-
Your deploy options have been saved to %s.
|
|
71
|
-
|
|
72
|
-
# DeployOptionsIncludedInGitIgnore
|
|
73
|
-
|
|
74
|
-
We added %s to the .gitignore for you.
|
|
75
|
-
|
|
76
|
-
# DeployersHaveNonZeroExitCode
|
|
77
|
-
|
|
78
|
-
One or more of the selected deployers exited with a non-zero exit code.
|
|
79
|
-
|
|
80
|
-
# DeployerExitCode
|
|
81
|
-
|
|
82
|
-
Deployer "%s" exited with code %d.
|
|
83
|
-
|
|
84
|
-
# save.as.default
|
|
85
|
-
|
|
86
|
-
Save username %s as default?
|
|
87
|
-
|
|
88
|
-
# deprecation
|
|
89
|
-
|
|
90
|
-
The top-level deploy command is deprecated. You should use `functions deploy` to deploy functions, and use `project deploy start` to deploy metadata to Salesforce orgs.
|