@salesforce/plugin-deploy-retrieve 1.3.0 → 1.4.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/CHANGELOG.md +6 -0
- package/README.md +385 -7
- package/lib/commands/deploy/metadata/cancel.d.ts +18 -0
- package/lib/commands/deploy/metadata/cancel.js +86 -0
- package/lib/commands/deploy/metadata/cancel.js.map +1 -0
- package/lib/commands/deploy/metadata/quick.d.ts +23 -0
- package/lib/commands/deploy/metadata/quick.js +116 -0
- package/lib/commands/deploy/metadata/quick.js.map +1 -0
- package/lib/commands/deploy/metadata/report.d.ts +14 -0
- package/lib/commands/deploy/metadata/report.js +54 -0
- package/lib/commands/deploy/metadata/report.js.map +1 -0
- package/lib/commands/deploy/metadata/resume.d.ts +21 -0
- package/lib/commands/deploy/metadata/resume.js +89 -0
- package/lib/commands/deploy/metadata/resume.js.map +1 -0
- package/lib/commands/deploy/metadata/validate.d.ts +27 -0
- package/lib/commands/deploy/metadata/validate.js +136 -0
- package/lib/commands/deploy/metadata/validate.js.map +1 -0
- package/lib/commands/deploy/metadata.d.ts +7 -9
- package/lib/commands/deploy/metadata.js +40 -15
- package/lib/commands/deploy/metadata.js.map +1 -1
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/retrieve/metadata.d.ts +4 -6
- package/lib/commands/retrieve/metadata.js +11 -25
- package/lib/commands/retrieve/metadata.js.map +1 -1
- package/lib/configMeta.d.ts +17 -0
- package/lib/configMeta.js +31 -0
- package/lib/configMeta.js.map +1 -0
- package/lib/utils/deploy.d.ts +26 -7
- package/lib/utils/deploy.js +114 -24
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/errorCodes.d.ts +3 -0
- package/lib/utils/errorCodes.js +26 -0
- package/lib/utils/errorCodes.js.map +1 -0
- package/lib/utils/metadataDeployer.js +7 -4
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +65 -8
- package/lib/utils/output.js +319 -169
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/types.d.ts +11 -5
- package/lib/utils/types.js.map +1 -1
- package/messages/cache.md +7 -0
- package/messages/config.md +7 -0
- package/messages/deploy.async.md +19 -0
- package/messages/deploy.metadata.cancel.md +62 -0
- package/messages/deploy.metadata.md +17 -3
- package/messages/deploy.metadata.quick.md +81 -0
- package/messages/deploy.metadata.report.md +42 -0
- package/messages/deploy.metadata.resume.md +58 -0
- package/messages/deploy.metadata.validate.md +123 -0
- package/messages/errorCodes.md +27 -0
- package/oclif.manifest.json +1 -1
- package/package.json +15 -9
- package/schemas/deploy-metadata-cancel.json +664 -0
- package/schemas/deploy-metadata-quick.json +664 -0
- package/schemas/deploy-metadata-report.json +664 -0
- package/schemas/deploy-metadata-resume.json +664 -0
- package/schemas/deploy-metadata-validate.json +664 -0
- package/schemas/deploy-metadata.json +592 -29
- package/schemas/hooks/sf-deploy.json +15 -5
- package/schemas/retrieve-metadata.json +178 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.4.0](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/v1.3.0...v1.4.0) (2022-05-03)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- support all deploy workflows ([#234](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/234)) ([29904cb](https://github.com/salesforcecli/plugin-deploy-retrieve/commit/29904cb5956433ed6fdde95a1d131d6539beeaa7)), closes [#235](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/235) [#238](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/238) [#239](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/239) [#243](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/243) [#244](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/244)
|
|
10
|
+
|
|
5
11
|
## [1.3.0](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/v1.2.1...v1.3.0) (2022-04-13)
|
|
6
12
|
|
|
7
13
|
### Features
|
package/README.md
CHANGED
|
@@ -64,6 +64,11 @@ sf plugins
|
|
|
64
64
|
|
|
65
65
|
- [`sf deploy`](#sf-deploy)
|
|
66
66
|
- [`sf deploy metadata`](#sf-deploy-metadata)
|
|
67
|
+
- [`sf deploy metadata cancel`](#sf-deploy-metadata-cancel)
|
|
68
|
+
- [`sf deploy metadata quick`](#sf-deploy-metadata-quick)
|
|
69
|
+
- [`sf deploy metadata report`](#sf-deploy-metadata-report)
|
|
70
|
+
- [`sf deploy metadata resume`](#sf-deploy-metadata-resume)
|
|
71
|
+
- [`sf deploy metadata validate`](#sf-deploy-metadata-validate)
|
|
67
72
|
- [`sf retrieve metadata`](#sf-retrieve-metadata)
|
|
68
73
|
|
|
69
74
|
## `sf deploy`
|
|
@@ -108,7 +113,7 @@ EXAMPLES
|
|
|
108
113
|
$ sf deploy --interactive
|
|
109
114
|
```
|
|
110
115
|
|
|
111
|
-
_See code: [src/commands/deploy.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/v1.
|
|
116
|
+
_See code: [src/commands/deploy.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/v1.3.0/src/commands/deploy.ts)_
|
|
112
117
|
|
|
113
118
|
## `sf deploy metadata`
|
|
114
119
|
|
|
@@ -116,8 +121,9 @@ Deploy metadata in source format to an org from your local project.
|
|
|
116
121
|
|
|
117
122
|
```
|
|
118
123
|
USAGE
|
|
119
|
-
$ sf deploy metadata [--json] [-a <value>] [--
|
|
120
|
-
<value>] [-
|
|
124
|
+
$ sf deploy metadata [--json] [-a <value>] [--async | -w <value>] [--concise | --verbose] [--dry-run] [-r] [-g] [-x
|
|
125
|
+
<value>] [-m <value>] [-d <value>] [-o <value>] [-t <value>] [-l
|
|
126
|
+
NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg]
|
|
121
127
|
|
|
122
128
|
FLAGS
|
|
123
129
|
-a, --api-version=<value> Target API version for the deploy.
|
|
@@ -132,6 +138,8 @@ FLAGS
|
|
|
132
138
|
-w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for command to complete and display
|
|
133
139
|
results.
|
|
134
140
|
-x, --manifest=<value> Full file path for manifest (package.xml) of components to deploy.
|
|
141
|
+
--async Run the command asynchronously.
|
|
142
|
+
--concise Show concise output of the deploy result.
|
|
135
143
|
--dry-run Validate deploy and run Apex tests but don’t save to the org.
|
|
136
144
|
--verbose Show verbose output of the deploy result.
|
|
137
145
|
|
|
@@ -146,9 +154,6 @@ DESCRIPTION
|
|
|
146
154
|
This command doesn't support source-tracking. The source you deploy overwrites the corresponding metadata in your org.
|
|
147
155
|
This command doesn’t attempt to merge your source with the versions in your org.
|
|
148
156
|
|
|
149
|
-
To run the command asynchronously, set --wait to 0, which immediately returns the job ID. This way, you can continue
|
|
150
|
-
to use the CLI.
|
|
151
|
-
|
|
152
157
|
To deploy multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
|
|
153
158
|
multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
|
|
154
159
|
applies to --manifest and --source-dir.
|
|
@@ -245,11 +250,384 @@ FLAG DESCRIPTIONS
|
|
|
245
250
|
|
|
246
251
|
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
247
252
|
|
|
248
|
-
If the command continues to run after the wait period, the CLI returns control of the terminal window to you
|
|
253
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
|
|
254
|
+
returns the job ID. To resume the deployment, run "sf deploy metadata resume". To check the status of the
|
|
255
|
+
deployment, run "sf deploy metadata report".
|
|
249
256
|
|
|
250
257
|
-x, --manifest=<value> Full file path for manifest (package.xml) of components to deploy.
|
|
251
258
|
|
|
252
259
|
All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
|
|
260
|
+
|
|
261
|
+
--async Run the command asynchronously.
|
|
262
|
+
|
|
263
|
+
The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the
|
|
264
|
+
CLI. To resume the deployment, run "sf deploy metadata resume". To check the status of the deployment, run "sf
|
|
265
|
+
deploy metadata report".
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## `sf deploy metadata cancel`
|
|
269
|
+
|
|
270
|
+
Cancel a deploy operation.
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
USAGE
|
|
274
|
+
$ sf deploy metadata cancel [--json] [--async | -w <value>] [-i <value>] [-r]
|
|
275
|
+
|
|
276
|
+
FLAGS
|
|
277
|
+
-i, --job-id=<value> Job ID of the deploy operation you want to cancel.
|
|
278
|
+
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
279
|
+
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
280
|
+
--async Run the command asynchronously.
|
|
281
|
+
|
|
282
|
+
GLOBAL FLAGS
|
|
283
|
+
--json Format output as json.
|
|
284
|
+
|
|
285
|
+
DESCRIPTION
|
|
286
|
+
Cancel a deploy operation.
|
|
287
|
+
|
|
288
|
+
Use this command to cancel a deploy operation that hasn't yet completed in the org. Deploy operations include standard
|
|
289
|
+
deploys, quick deploys, deploy validations, and deploy cancellations.
|
|
290
|
+
|
|
291
|
+
Run this command by either passing it a job ID or specifying the --use-most-recent flag to use the job ID of the most
|
|
292
|
+
recent deploy operation.
|
|
293
|
+
|
|
294
|
+
EXAMPLES
|
|
295
|
+
Cancel a deploy operation using a job ID:
|
|
296
|
+
|
|
297
|
+
$ sf deploy metadata cancel --job-id 0Af0x000017yLUFCA2
|
|
298
|
+
|
|
299
|
+
Cancel the most recent deploy operation:
|
|
300
|
+
|
|
301
|
+
$ sf deploy metadata cancel --use-most-recent
|
|
302
|
+
|
|
303
|
+
FLAG DESCRIPTIONS
|
|
304
|
+
-i, --job-id=<value> Job ID of the deploy operation you want to cancel.
|
|
305
|
+
|
|
306
|
+
These commands return a job ID if they time out or you specified the --async flag:
|
|
307
|
+
|
|
308
|
+
- sf deploy metadata
|
|
309
|
+
- sf deploy metadata validate
|
|
310
|
+
- sf deploy metadata quick
|
|
311
|
+
- sf deploy metadata cancel
|
|
312
|
+
|
|
313
|
+
The job ID is valid for 10 days from when you started the deploy operation.
|
|
314
|
+
|
|
315
|
+
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
316
|
+
|
|
317
|
+
For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less.
|
|
318
|
+
If your most recent deploy operations was more than 3 days ago, this flag won't find a job ID.
|
|
319
|
+
|
|
320
|
+
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
321
|
+
|
|
322
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
|
|
323
|
+
resume watching the cancellation, run "sf deploy metadata resume". To check the status of the cancellation, run "sf
|
|
324
|
+
deploy metadata report".
|
|
325
|
+
|
|
326
|
+
--async Run the command asynchronously.
|
|
327
|
+
|
|
328
|
+
The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To
|
|
329
|
+
resume watching the cancellation, run "sf deploy metadata resume". To check the status of the cancellation, run "sf
|
|
330
|
+
deploy metadata report".
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## `sf deploy metadata quick`
|
|
334
|
+
|
|
335
|
+
Quickly deploy a validated deployment to an org.
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
USAGE
|
|
339
|
+
$ sf deploy metadata quick [--json] [--async | -w <value>] [--concise | --verbose] [-i <value>] [-o <value>] [-r]
|
|
340
|
+
|
|
341
|
+
FLAGS
|
|
342
|
+
-i, --job-id=<value> Job ID of the deployment you want to quick deploy.
|
|
343
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
344
|
+
-r, --use-most-recent Use the job ID of the most recently validated deployment.
|
|
345
|
+
-w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for the command to complete and display
|
|
346
|
+
results.
|
|
347
|
+
--async Run the command asynchronously.
|
|
348
|
+
--concise Show concise output of the deploy result.
|
|
349
|
+
--verbose Show verbose output of the deploy result.
|
|
350
|
+
|
|
351
|
+
GLOBAL FLAGS
|
|
352
|
+
--json Format output as json.
|
|
353
|
+
|
|
354
|
+
DESCRIPTION
|
|
355
|
+
Quickly deploy a validated deployment to an org.
|
|
356
|
+
|
|
357
|
+
Before you run this command, first create a validated deployment with the "sf deploy metadata validate" command, which
|
|
358
|
+
returns a job ID. Validated deployments haven't been deployed to the org yet; you deploy them with this command.
|
|
359
|
+
Either pass the job ID to this command or use the --use-most-recent flag to use the job ID of the most recently
|
|
360
|
+
validated deployment. For the quick deploy to succeed, the associated validated deployment must also have succeeded.
|
|
361
|
+
|
|
362
|
+
Executing this quick deploy command takes less time than a standard deploy because it skips running Apex tests. These
|
|
363
|
+
tests were previously run as part of the validation. Validating first and then running a quick deploy is useful if the
|
|
364
|
+
deployment to your production org take several hours and you don’t want to risk a failed deploy.
|
|
365
|
+
|
|
366
|
+
This command doesn't support source-tracking. The source you deploy overwrites the corresponding metadata in your org.
|
|
367
|
+
This command doesn’t attempt to merge your source with the versions in your org.
|
|
368
|
+
|
|
369
|
+
EXAMPLES
|
|
370
|
+
Run a quick deploy to your default org using a job ID:
|
|
371
|
+
|
|
372
|
+
$ sf deploy metadata quick --job-id 0Af0x000017yLUFCA2
|
|
373
|
+
|
|
374
|
+
Asynchronously run a quick deploy of the most recently validated deployment to an org with alias "my-prod-org":
|
|
375
|
+
|
|
376
|
+
$ sf deploy metadata quick --async --use-most-recent --target-org my-prod-org
|
|
377
|
+
|
|
378
|
+
FLAG DESCRIPTIONS
|
|
379
|
+
-i, --job-id=<value> Job ID of the deployment you want to quick deploy.
|
|
380
|
+
|
|
381
|
+
The job ID is valid for 10 days from when you started the validation.
|
|
382
|
+
|
|
383
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
384
|
+
|
|
385
|
+
Overrides your default org.
|
|
386
|
+
|
|
387
|
+
-r, --use-most-recent Use the job ID of the most recently validated deployment.
|
|
388
|
+
|
|
389
|
+
For performance reasons, this flag uses only job IDs that were validated in the past 3 days or less. If your most
|
|
390
|
+
recent deployment validation was more than 3 days ago, this flag won't find a job ID.
|
|
391
|
+
|
|
392
|
+
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
393
|
+
|
|
394
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
|
|
395
|
+
resume watching the deploy, run "sf deploy metadata resume". To check the status of the deploy, run "sf deploy
|
|
396
|
+
metadata report".
|
|
397
|
+
|
|
398
|
+
--async Run the command asynchronously.
|
|
399
|
+
|
|
400
|
+
The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To
|
|
401
|
+
resume watching the deploy, run "sf deploy metadata resume". To check the status of the deploy, run "sf deploy
|
|
402
|
+
metadata report".
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## `sf deploy metadata report`
|
|
406
|
+
|
|
407
|
+
Check the status of a deploy operation.
|
|
408
|
+
|
|
409
|
+
```
|
|
410
|
+
USAGE
|
|
411
|
+
$ sf deploy metadata report [--json] [-i <value>] [-r]
|
|
412
|
+
|
|
413
|
+
FLAGS
|
|
414
|
+
-i, --job-id=<value> Job ID of the deploy operation you want to check the status of.
|
|
415
|
+
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
416
|
+
|
|
417
|
+
GLOBAL FLAGS
|
|
418
|
+
--json Format output as json.
|
|
419
|
+
|
|
420
|
+
DESCRIPTION
|
|
421
|
+
Check the status of a deploy operation.
|
|
422
|
+
|
|
423
|
+
Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations.
|
|
424
|
+
|
|
425
|
+
Run this command by either passing it a job ID or specifying the --use-most-recent flag to use the job ID of the most
|
|
426
|
+
recent deploy operation.
|
|
427
|
+
|
|
428
|
+
EXAMPLES
|
|
429
|
+
Check the status using a job ID:
|
|
430
|
+
|
|
431
|
+
$ sf deploy metadata report --job-id 0Af0x000017yLUFCA2
|
|
432
|
+
|
|
433
|
+
Check the status of the most recent deploy operation:
|
|
434
|
+
|
|
435
|
+
$ sf deploy metadata report --use-most-recent
|
|
436
|
+
|
|
437
|
+
FLAG DESCRIPTIONS
|
|
438
|
+
-i, --job-id=<value> Job ID of the deploy operation you want to check the status of.
|
|
439
|
+
|
|
440
|
+
These commands return a job ID if they time out or you specified the --async flag:
|
|
441
|
+
|
|
442
|
+
- sf deploy metadata
|
|
443
|
+
- sf deploy metadata validate
|
|
444
|
+
- sf deploy metadata quick
|
|
445
|
+
- sf deploy metadata cancel
|
|
446
|
+
|
|
447
|
+
The job ID is valid for 10 days from when you started the deploy operation.
|
|
448
|
+
|
|
449
|
+
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
450
|
+
|
|
451
|
+
For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less.
|
|
452
|
+
If your most recent operation was more than 3 days ago, this flag won't find a job ID.
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
## `sf deploy metadata resume`
|
|
456
|
+
|
|
457
|
+
Resume watching a deploy operation.
|
|
458
|
+
|
|
459
|
+
```
|
|
460
|
+
USAGE
|
|
461
|
+
$ sf deploy metadata resume [--json] [--concise | --verbose] [-i <value>] [-r] [-w <value>]
|
|
462
|
+
|
|
463
|
+
FLAGS
|
|
464
|
+
-i, --job-id=<value> Job ID of the deploy operation you want to resume.
|
|
465
|
+
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
466
|
+
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
467
|
+
--concise Show concise output of the deploy operation result.
|
|
468
|
+
--verbose Show verbose output of the deploy operation result.
|
|
469
|
+
|
|
470
|
+
GLOBAL FLAGS
|
|
471
|
+
--json Format output as json.
|
|
472
|
+
|
|
473
|
+
DESCRIPTION
|
|
474
|
+
Resume watching a deploy operation.
|
|
475
|
+
|
|
476
|
+
Use this command to resume watching a deploy operation if the original command times out or you specified the --async
|
|
477
|
+
flag. Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations. This
|
|
478
|
+
command doesn't resume the original operation itself, because the operation always continues after you've started it,
|
|
479
|
+
regardless of whether you're watching it or not.
|
|
480
|
+
|
|
481
|
+
Run this command by either passing it a job ID or specifying the --use-most-recent flag to use the job ID of the most
|
|
482
|
+
recent deploy operation.
|
|
483
|
+
|
|
484
|
+
EXAMPLES
|
|
485
|
+
Resume watching a deploy operation using a job ID:
|
|
486
|
+
|
|
487
|
+
$ sf deploy metadata resume --job-id 0Af0x000017yLUFCA2
|
|
488
|
+
|
|
489
|
+
Resume watching the most recent deploy operation:
|
|
490
|
+
|
|
491
|
+
$ sf deploy metadata resume --use-most-recent
|
|
492
|
+
|
|
493
|
+
FLAG DESCRIPTIONS
|
|
494
|
+
-i, --job-id=<value> Job ID of the deploy operation you want to resume.
|
|
495
|
+
|
|
496
|
+
These commands return a job ID if they time out or you specified the --async flag:
|
|
497
|
+
|
|
498
|
+
- sf deploy metadata
|
|
499
|
+
- sf deploy metadata validate
|
|
500
|
+
- sf deploy metadata quick
|
|
501
|
+
- sf deploy metadata cancel
|
|
502
|
+
|
|
503
|
+
The job ID is valid for 10 days from when you started the deploy operation.
|
|
504
|
+
|
|
505
|
+
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
506
|
+
|
|
507
|
+
For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less.
|
|
508
|
+
If your most recent operation was more than 3 days ago, this flag won't find a job ID.
|
|
509
|
+
|
|
510
|
+
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
511
|
+
|
|
512
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
|
|
513
|
+
resume watching the deploy operation, run this command again. To check the status of the deploy operation, run "sf
|
|
514
|
+
deploy metadata report".
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## `sf deploy metadata validate`
|
|
518
|
+
|
|
519
|
+
Validate a metadata deployment without actually executing it.
|
|
520
|
+
|
|
521
|
+
```
|
|
522
|
+
USAGE
|
|
523
|
+
$ sf deploy metadata validate [--json] [-a <value>] [--async] [--concise | --verbose] [-x <value> | -m <value> | -d <value>]
|
|
524
|
+
[-o <value>] [-t <value>] [-l RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests] [-w <value>]
|
|
525
|
+
|
|
526
|
+
FLAGS
|
|
527
|
+
-a, --api-version=<value> Target API version for the validation.
|
|
528
|
+
-d, --source-dir=<value>... Path to the local source files to validate for deployment.
|
|
529
|
+
-l, --test-level=<option> [default: RunLocalTests] Deployment Apex testing level.
|
|
530
|
+
<options: RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests>
|
|
531
|
+
-m, --metadata=<value>... Metadata component names to validate for deployment.
|
|
532
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
533
|
+
-t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
534
|
+
-w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for the command to complete and display
|
|
535
|
+
results.
|
|
536
|
+
-x, --manifest=<value> Full file path for manifest (package.xml) of components to validate for deployment.
|
|
537
|
+
--async Run the command asynchronously.
|
|
538
|
+
--concise Show concise output of the validation result.
|
|
539
|
+
--verbose Show verbose output of the validation result.
|
|
540
|
+
|
|
541
|
+
GLOBAL FLAGS
|
|
542
|
+
--json Format output as json.
|
|
543
|
+
|
|
544
|
+
DESCRIPTION
|
|
545
|
+
Validate a metadata deployment without actually executing it.
|
|
546
|
+
|
|
547
|
+
Use this command to verify whether a deployment will succeed without actually deploying the metadata to your org. This
|
|
548
|
+
command is similar to "sf deploy metadata", except you're required to run Apex tests, and the command returns a job ID
|
|
549
|
+
rather than executing the deployment. If the validation succeeds, then you pass this job ID to the "sf deploy metadata
|
|
550
|
+
quick" command to actually deploy the metadata. This quick deploy takes less time because it skips running Apex tests.
|
|
551
|
+
The job ID is valid for 10 days from when you started the validation. Validating first is useful if the deployment to
|
|
552
|
+
your production org take several hours and you don’t want to risk a failed deploy.
|
|
553
|
+
|
|
554
|
+
You must run this command from within a project.
|
|
555
|
+
|
|
556
|
+
This command doesn't support source-tracking. When you quick deploy with the resulting job ID, the source you deploy
|
|
557
|
+
overwrites the corresponding metadata in your org.
|
|
558
|
+
|
|
559
|
+
To validate the deployment of multiple metadata components, either set multiple --metadata <name> flags or a single
|
|
560
|
+
--metadata flag with multiple names separated by spaces. Enclose names that contain spaces in one set of double
|
|
561
|
+
quotes. The same syntax applies to --manifest and --source-dir.
|
|
562
|
+
|
|
563
|
+
EXAMPLES
|
|
564
|
+
NOTE: These examples focus on validating large deployments. See the help for "sf deploy metadata" for examples of deploying smaller sets of metadata which you can also use to validate.
|
|
565
|
+
|
|
566
|
+
Validate the deployment of all source files in a directory to the default org:
|
|
567
|
+
|
|
568
|
+
$ sf deploy metadata validate --source-dir path/to/source
|
|
569
|
+
|
|
570
|
+
Asynchronously validate the deployment and run all tests in the org with alias "my-prod-org"; command immediately
|
|
571
|
+
returns the job ID:
|
|
572
|
+
|
|
573
|
+
$ sf deploy metadata validate --source-dir path/to/source --async --test-level RunAllTestsInOrg --target-org \
|
|
574
|
+
my-prod-org
|
|
575
|
+
|
|
576
|
+
Validate the deployment of all components listed in a manifest:
|
|
577
|
+
|
|
578
|
+
$ sf deploy metadata validate --manifest path/to/package.xml
|
|
579
|
+
|
|
580
|
+
FLAG DESCRIPTIONS
|
|
581
|
+
-a, --api-version=<value> Target API version for the validation.
|
|
582
|
+
|
|
583
|
+
Use this flag to override the default API version, which is the latest version supported the CLI, with the API
|
|
584
|
+
version in your package.xml file.
|
|
585
|
+
|
|
586
|
+
-d, --source-dir=<value>... Path to the local source files to validate for deployment.
|
|
587
|
+
|
|
588
|
+
The supplied path can be to a single file (in which case the operation is applied to only one file) or to a folder
|
|
589
|
+
(in which case the operation is applied to all metadata types in the directory and its subdirectories).
|
|
590
|
+
|
|
591
|
+
If you specify this flag, don’t specify --metadata or --manifest.
|
|
592
|
+
|
|
593
|
+
-l, --test-level=RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests Deployment Apex testing level.
|
|
594
|
+
|
|
595
|
+
Valid values are:
|
|
596
|
+
|
|
597
|
+
- RunSpecifiedTests — Runs only the tests that you specify with the --run-tests flag. Code coverage requirements
|
|
598
|
+
differ from the default coverage requirements when using this test level. Executed tests must comprise a minimum of
|
|
599
|
+
75% code coverage for each class and trigger in the deployment package. This coverage is computed for each class and
|
|
600
|
+
trigger individually and is different than the overall coverage percentage.
|
|
601
|
+
|
|
602
|
+
- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
|
|
603
|
+
packages. This test level is the default for production deployments that include Apex classes or triggers.
|
|
604
|
+
|
|
605
|
+
- RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
|
|
606
|
+
|
|
607
|
+
If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more
|
|
608
|
+
information, see [Running Tests in a
|
|
609
|
+
Deployment](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm)
|
|
610
|
+
in the "Metadata API Developer Guide".
|
|
611
|
+
|
|
612
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
613
|
+
|
|
614
|
+
Overrides your default org.
|
|
615
|
+
|
|
616
|
+
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
617
|
+
|
|
618
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
|
|
619
|
+
returns the job ID. To resume watching the validation, run "sf deploy metadata resume". To check the status of the
|
|
620
|
+
validation, run "sf deploy metadata report".
|
|
621
|
+
|
|
622
|
+
-x, --manifest=<value> Full file path for manifest (package.xml) of components to validate for deployment.
|
|
623
|
+
|
|
624
|
+
All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
|
|
625
|
+
|
|
626
|
+
--async Run the command asynchronously.
|
|
627
|
+
|
|
628
|
+
The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the
|
|
629
|
+
CLI. To resume watching the validation, run "sf deploy metadata resume". To check the status of the validation, run
|
|
630
|
+
"sf deploy metadata report".
|
|
253
631
|
```
|
|
254
632
|
|
|
255
633
|
## `sf retrieve metadata`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Duration } from '@salesforce/kit';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { DeployResultJson } from '../../../utils/types';
|
|
4
|
+
export default class DeployMetadataCancel extends SfCommand<DeployResultJson> {
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly summary: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly requiresProject = true;
|
|
9
|
+
static readonly state = "beta";
|
|
10
|
+
static flags: {
|
|
11
|
+
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'job-id': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
13
|
+
'use-most-recent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
wait: import("@oclif/core/lib/interfaces").OptionFlag<Duration>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<DeployResultJson>;
|
|
17
|
+
protected catch(error: SfCommand.Error): Promise<SfCommand.Error>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 kit_1 = require("@salesforce/kit");
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const deploy_1 = require("../../../utils/deploy");
|
|
13
|
+
const output_1 = require("../../../utils/output");
|
|
14
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
15
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.cancel');
|
|
16
|
+
class DeployMetadataCancel extends sf_plugins_core_1.SfCommand {
|
|
17
|
+
async run() {
|
|
18
|
+
const { flags } = await this.parse(DeployMetadataCancel);
|
|
19
|
+
const cache = await deploy_1.DeployCache.create();
|
|
20
|
+
const jobId = cache.resolveLatest(flags['use-most-recent'], flags['job-id']);
|
|
21
|
+
const deployOpts = cache.get(jobId);
|
|
22
|
+
if (flags.async) {
|
|
23
|
+
const asyncResult = await (0, deploy_1.cancelDeployAsync)({ 'target-org': deployOpts['target-org'] }, jobId);
|
|
24
|
+
const formatter = new output_1.AsyncDeployCancelResultFormatter(asyncResult.id);
|
|
25
|
+
if (!this.jsonEnabled())
|
|
26
|
+
formatter.display();
|
|
27
|
+
return formatter.getJson();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const wait = flags.wait || kit_1.Duration.minutes(deployOpts.wait);
|
|
31
|
+
const result = await (0, deploy_1.cancelDeploy)({ ...deployOpts, wait }, jobId);
|
|
32
|
+
const formatter = new output_1.DeployCancelResultFormatter(result);
|
|
33
|
+
if (!this.jsonEnabled())
|
|
34
|
+
formatter.display();
|
|
35
|
+
if ((0, deploy_1.shouldRemoveFromCache)(result.response.status)) {
|
|
36
|
+
cache.unset(result.response.id);
|
|
37
|
+
cache.unset(jobId);
|
|
38
|
+
await cache.write();
|
|
39
|
+
}
|
|
40
|
+
return formatter.getJson();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch(error) {
|
|
44
|
+
if (error.name.includes('INVALID_ID_FIELD')) {
|
|
45
|
+
const err = messages.createError('error.CannotCancelDeploy');
|
|
46
|
+
return super.catch({ ...error, name: err.name, message: err.message, code: err.code });
|
|
47
|
+
}
|
|
48
|
+
return super.catch(error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = DeployMetadataCancel;
|
|
52
|
+
DeployMetadataCancel.description = messages.getMessage('description');
|
|
53
|
+
DeployMetadataCancel.summary = messages.getMessage('summary');
|
|
54
|
+
DeployMetadataCancel.examples = messages.getMessages('examples');
|
|
55
|
+
DeployMetadataCancel.requiresProject = true;
|
|
56
|
+
DeployMetadataCancel.state = 'beta';
|
|
57
|
+
DeployMetadataCancel.flags = {
|
|
58
|
+
async: sf_plugins_core_1.Flags.boolean({
|
|
59
|
+
summary: messages.getMessage('flags.async.summary'),
|
|
60
|
+
description: messages.getMessage('flags.async.description'),
|
|
61
|
+
exclusive: ['wait'],
|
|
62
|
+
}),
|
|
63
|
+
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
64
|
+
char: 'i',
|
|
65
|
+
startsWith: '0Af',
|
|
66
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
67
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
68
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
69
|
+
}),
|
|
70
|
+
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
71
|
+
char: 'r',
|
|
72
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
73
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
74
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
75
|
+
}),
|
|
76
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
77
|
+
char: 'w',
|
|
78
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
79
|
+
description: messages.getMessage('flags.wait.description'),
|
|
80
|
+
unit: 'minutes',
|
|
81
|
+
helpValue: '<minutes>',
|
|
82
|
+
min: 1,
|
|
83
|
+
exclusive: ['async'],
|
|
84
|
+
}),
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../../src/commands/deploy/metadata/cancel.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA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AE,QAAQ,CAAC,UAAU,CAAC,yBAAyB,CAAC;QAC3D,SAAS,EAAE,CAAC,MAAM,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,uBAAK,CAAC,YAAY,CAAC;QAC3B,IAAI,EAAE,GAAG;QACT,UAAU,EAAE,KAAK;QACjB,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;IACF,IAAI,EAAE,uBAAK,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QAC1D,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,WAAW;QACtB,GAAG,EAAE,CAAC;QACN,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Org } from '@salesforce/core';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { DeployResultJson } from '../../../utils/types';
|
|
4
|
+
export default class DeployMetadataQuick extends SfCommand<DeployResultJson> {
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly summary: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly requiresProject = true;
|
|
9
|
+
static readonly state = "beta";
|
|
10
|
+
static flags: {
|
|
11
|
+
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
concise: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'job-id': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
14
|
+
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<Org>;
|
|
15
|
+
'use-most-recent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
wait: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/kit").Duration>;
|
|
18
|
+
};
|
|
19
|
+
static errorCodes: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
20
|
+
run(): Promise<DeployResultJson>;
|
|
21
|
+
protected catch(error: SfCommand.Error): Promise<SfCommand.Error>;
|
|
22
|
+
private setExitCode;
|
|
23
|
+
}
|