@salesforce/plugin-deploy-retrieve 1.19.2 → 1.20.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 +951 -323
- package/lib/commands/deploy.js +6 -6
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/project/convert/mdapi.js +4 -4
- package/lib/commands/project/convert/mdapi.js.map +1 -1
- package/lib/commands/project/convert/source.js +3 -3
- package/lib/commands/project/convert/source.js.map +1 -1
- package/lib/commands/project/delete/source.js +4 -4
- package/lib/commands/project/delete/source.js.map +1 -1
- package/lib/commands/project/deploy/cancel.js +7 -2
- package/lib/commands/project/deploy/cancel.js.map +1 -1
- package/lib/commands/project/deploy/preview.js +1 -1
- package/lib/commands/project/deploy/preview.js.map +1 -1
- package/lib/commands/project/deploy/quick.js +10 -4
- package/lib/commands/project/deploy/quick.js.map +1 -1
- package/lib/commands/project/deploy/report.js +3 -2
- package/lib/commands/project/deploy/report.js.map +1 -1
- package/lib/commands/project/deploy/resume.js +3 -2
- package/lib/commands/project/deploy/resume.js.map +1 -1
- package/lib/commands/project/deploy/start.js +7 -2
- package/lib/commands/project/deploy/start.js.map +1 -1
- package/lib/commands/project/deploy/validate.js +2 -2
- package/lib/commands/project/deploy/validate.js.map +1 -1
- package/lib/commands/project/generate/manifest.js +4 -4
- package/lib/commands/project/generate/manifest.js.map +1 -1
- package/lib/commands/project/list/ignored.js +2 -2
- package/lib/commands/project/list/ignored.js.map +1 -1
- package/lib/commands/project/retrieve/preview.js +1 -1
- package/lib/commands/project/retrieve/preview.js.map +1 -1
- package/lib/commands/project/retrieve/start.js +15 -15
- package/lib/commands/project/retrieve/start.js.map +1 -1
- package/lib/configMeta.js +2 -2
- package/lib/configMeta.js.map +1 -1
- package/lib/formatters/deployResultFormatter.js +6 -6
- package/lib/formatters/deployResultFormatter.js.map +1 -1
- package/lib/formatters/metadataConvertResultFormatter.js +1 -1
- package/lib/formatters/metadataConvertResultFormatter.js.map +1 -1
- package/lib/formatters/metadataRetrieveResultFormatter.js +1 -1
- package/lib/formatters/metadataRetrieveResultFormatter.js.map +1 -1
- package/lib/formatters/retrieveResultFormatter.js +1 -1
- package/lib/formatters/retrieveResultFormatter.js.map +1 -1
- package/lib/formatters/sourceConvertResultFormatter.js +2 -2
- package/lib/formatters/sourceConvertResultFormatter.js.map +1 -1
- package/lib/formatters/testResultsFormatter.js +1 -1
- package/lib/formatters/testResultsFormatter.js.map +1 -1
- package/lib/utils/coverage.js +1 -1
- package/lib/utils/coverage.js.map +1 -1
- package/lib/utils/deploy.js +2 -2
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/flags.js +4 -4
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/manifestCache.js +4 -4
- package/lib/utils/manifestCache.js.map +1 -1
- package/lib/utils/metadataDeployer.js +2 -2
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.js +1 -1
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/previewOutput.js +1 -1
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/types.js +2 -2
- package/lib/utils/types.js.map +1 -1
- package/oclif.manifest.json +2 -2
- package/package.json +17 -38
- package/schemas/hooks/sf-deploy.json +3 -0
package/README.md
CHANGED
|
@@ -64,173 +64,248 @@ sf plugins
|
|
|
64
64
|
|
|
65
65
|
<!-- commands -->
|
|
66
66
|
|
|
67
|
-
- [`sf
|
|
68
|
-
- [`sf
|
|
69
|
-
- [`sf
|
|
70
|
-
- [`sf
|
|
71
|
-
- [`sf deploy
|
|
72
|
-
- [`sf deploy
|
|
73
|
-
- [`sf deploy
|
|
74
|
-
- [`sf deploy
|
|
75
|
-
- [`sf
|
|
76
|
-
- [`sf
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
- [`sf project convert mdapi`](#sf-project-convert-mdapi)
|
|
68
|
+
- [`sf project convert source`](#sf-project-convert-source)
|
|
69
|
+
- [`sf project delete source`](#sf-project-delete-source)
|
|
70
|
+
- [`sf project delete tracking`](#sf-project-delete-tracking)
|
|
71
|
+
- [`sf project deploy cancel`](#sf-project-deploy-cancel)
|
|
72
|
+
- [`sf project deploy preview`](#sf-project-deploy-preview)
|
|
73
|
+
- [`sf project deploy quick`](#sf-project-deploy-quick)
|
|
74
|
+
- [`sf project deploy report`](#sf-project-deploy-report)
|
|
75
|
+
- [`sf project deploy resume`](#sf-project-deploy-resume)
|
|
76
|
+
- [`sf project deploy start`](#sf-project-deploy-start)
|
|
77
|
+
- [`sf project deploy validate`](#sf-project-deploy-validate)
|
|
78
|
+
- [`sf project generate manifest`](#sf-project-generate-manifest)
|
|
79
|
+
- [`sf project list ignored`](#sf-project-list-ignored)
|
|
80
|
+
- [`sf project reset tracking`](#sf-project-reset-tracking)
|
|
81
|
+
- [`sf project retrieve preview`](#sf-project-retrieve-preview)
|
|
82
|
+
- [`sf project retrieve start`](#sf-project-retrieve-start)
|
|
83
|
+
|
|
84
|
+
## `sf project convert mdapi`
|
|
85
|
+
|
|
86
|
+
Convert metadata retrieved via Metadata API into the source format used in Salesforce DX projects.
|
|
81
87
|
|
|
82
88
|
```
|
|
83
89
|
USAGE
|
|
84
|
-
$ sf
|
|
90
|
+
$ sf project convert mdapi -r <value> [--json] [--api-version <value>] [-d <value>] [-p <value> | -x <value> | -m
|
|
91
|
+
<value>]
|
|
85
92
|
|
|
86
93
|
FLAGS
|
|
87
|
-
--
|
|
94
|
+
-d, --output-dir=<value> Directory to store your files in after they’re converted to source format; can be an
|
|
95
|
+
absolute or relative path.
|
|
96
|
+
-m, --metadata=<value>... Metadata component names to convert.
|
|
97
|
+
-p, --metadata-dir=<value>... Root of directory or zip file of metadata formatted files to convert.
|
|
98
|
+
-r, --root-dir=<value> (required) Root directory that contains the Metadata API–formatted metadata.
|
|
99
|
+
-x, --manifest=<value> File path to manifest (package.xml) of metadata types to convert.
|
|
100
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
88
101
|
|
|
89
|
-
|
|
90
|
-
|
|
102
|
+
GLOBAL FLAGS
|
|
103
|
+
--json Format output as json.
|
|
91
104
|
|
|
92
|
-
|
|
105
|
+
DESCRIPTION
|
|
106
|
+
Convert metadata retrieved via Metadata API into the source format used in Salesforce DX projects.
|
|
93
107
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
provides intelligent choices based on its analysis.
|
|
108
|
+
To use Salesforce CLI to work with components that you retrieved via Metadata API, first convert your files from the
|
|
109
|
+
metadata format to the source format using this command.
|
|
97
110
|
|
|
98
|
-
|
|
99
|
-
if you want to deploy that Salesforce app to an org. The command lists your connected orgs and asks which one you want
|
|
100
|
-
to deploy to. The list of orgs starts with scratch orgs, ordered by expiration date with the most recently created one
|
|
101
|
-
first, and then Dev Hub and production orgs ordered by name. If the command finds Apex tests, it asks if you want to
|
|
102
|
-
run them and at which level.
|
|
111
|
+
To convert files from the source format back to the metadata format, run "sf project convert source".
|
|
103
112
|
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
To convert multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
|
|
114
|
+
multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
|
|
115
|
+
applies to --manifest and --source-dir.
|
|
106
116
|
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
ALIASES
|
|
118
|
+
$ sf force mdapi convert
|
|
109
119
|
|
|
110
120
|
EXAMPLES
|
|
111
|
-
|
|
121
|
+
Convert metadata formatted files in the specified directory into source formatted files; writes converted files to
|
|
122
|
+
your default package directory:
|
|
123
|
+
|
|
124
|
+
$ sf project convert mdapi --root-dir path/to/metadata
|
|
125
|
+
|
|
126
|
+
Similar to previous example, but writes converted files to the specified output directory:
|
|
127
|
+
|
|
128
|
+
$ sf project convert mdapi --root-dir path/to/metadata --output-dir path/to/outputdir
|
|
129
|
+
|
|
130
|
+
FLAG DESCRIPTIONS
|
|
131
|
+
-p, --metadata-dir=<value>... Root of directory or zip file of metadata formatted files to convert.
|
|
132
|
+
|
|
133
|
+
The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder
|
|
134
|
+
(in which case the operation is applied to all metadata types in the directory and its sub-directories).
|
|
112
135
|
|
|
113
|
-
|
|
136
|
+
If you specify this flag, don’t specify --manifest or --metadata. If the comma-separated list you’re supplying
|
|
137
|
+
contains spaces, enclose the entire comma-separated list in one set of double quotes.
|
|
114
138
|
|
|
115
|
-
|
|
139
|
+
-x, --manifest=<value> File path to manifest (package.xml) of metadata types to convert.
|
|
116
140
|
|
|
117
|
-
|
|
141
|
+
If you specify this parameter, don’t specify --metadata or --source-dir.
|
|
118
142
|
```
|
|
119
143
|
|
|
120
|
-
_See code: [src/commands/
|
|
144
|
+
_See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/convert/mdapi.ts)_
|
|
121
145
|
|
|
122
|
-
## `sf
|
|
146
|
+
## `sf project convert source`
|
|
123
147
|
|
|
124
|
-
|
|
148
|
+
Convert source-formatted files into metadata that you can deploy using Metadata API.
|
|
125
149
|
|
|
126
150
|
```
|
|
127
151
|
USAGE
|
|
128
|
-
$ sf
|
|
129
|
-
|
|
130
|
-
[-l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg]
|
|
152
|
+
$ sf project convert source [--json] [--api-version <value>] [-r <value>] [-d <value>] [-n <value>] [-p <value> | -x
|
|
153
|
+
<value> | -m <value>]
|
|
131
154
|
|
|
132
155
|
FLAGS
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
143
|
-
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
144
|
-
-x, --manifest=<value> Full file path for manifest (package.xml) of components to deploy.
|
|
145
|
-
--async Run the command asynchronously.
|
|
146
|
-
--concise Show concise output of the deploy result.
|
|
147
|
-
--dry-run Validate deploy and run Apex tests but don’t save to the org.
|
|
148
|
-
--metadata-dir=<value> Root of directory or zip file of metadata formatted files to deploy.
|
|
149
|
-
--single-package Indicates that the metadata zip file points to a directory structure for a single
|
|
150
|
-
package.
|
|
151
|
-
--verbose Show verbose output of the deploy result.
|
|
156
|
+
-d, --output-dir=<value> [default: metadataPackage_1699371527053] Output directory to store the Metadata
|
|
157
|
+
API–formatted files in.
|
|
158
|
+
-m, --metadata=<value>... Metadata component names to convert.
|
|
159
|
+
-n, --package-name=<value> Name of the package to associate with the metadata-formatted files.
|
|
160
|
+
-p, --source-dir=<value>... Paths to the local source files to convert.
|
|
161
|
+
-r, --root-dir=<value> Source directory other than the default package to convert.
|
|
162
|
+
-x, --manifest=<value> Path to the manifest (package.xml) file that specifies the metadata types to convert.
|
|
163
|
+
--api-version=<value> API Version to use in the generated project's manifest. By default, will use the version
|
|
164
|
+
from sfdx-project.json
|
|
152
165
|
|
|
153
166
|
GLOBAL FLAGS
|
|
154
167
|
--json Format output as json.
|
|
155
168
|
|
|
156
169
|
DESCRIPTION
|
|
157
|
-
|
|
170
|
+
Convert source-formatted files into metadata that you can deploy using Metadata API.
|
|
158
171
|
|
|
159
|
-
|
|
172
|
+
To convert source-formatted files into the metadata format, so that you can deploy them using Metadata API, run this
|
|
173
|
+
command. Then deploy the metadata using "sf project deploy".
|
|
160
174
|
|
|
161
|
-
Metadata
|
|
162
|
-
--metadata-dir flag, which specifies the root directory or ZIP file that contains the metadata formatted files you
|
|
163
|
-
want to deploy.
|
|
175
|
+
To convert Metadata API–formatted files into the source format, run "sf project convert mdapi".
|
|
164
176
|
|
|
165
|
-
|
|
166
|
-
org, never allow source tracking. You can also use the "--no-track-source" flag when you create a scratch or sandbox
|
|
167
|
-
org to disable source tracking.
|
|
177
|
+
To specify a package name that includes spaces, enclose the name in single quotes.
|
|
168
178
|
|
|
169
|
-
To
|
|
170
|
-
|
|
171
|
-
|
|
179
|
+
To convert multiple components, either set multiple --metadata <name> flags or a single --metadata flag with multiple
|
|
180
|
+
names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax applies to
|
|
181
|
+
--manifest and --source-dir.
|
|
182
|
+
|
|
183
|
+
ALIASES
|
|
184
|
+
$ sf force source convert
|
|
172
185
|
|
|
173
186
|
EXAMPLES
|
|
174
|
-
|
|
187
|
+
Convert source-formatted files in the specified directory into metadata-formatted files; writes converted files into
|
|
188
|
+
a new directory:
|
|
175
189
|
|
|
176
|
-
$ sf
|
|
190
|
+
$ sf project convert source --root-dir path/to/source
|
|
177
191
|
|
|
178
|
-
|
|
192
|
+
Similar to previous example, but writes converted files to the specified output directory and associates the files
|
|
193
|
+
with the specified package:
|
|
179
194
|
|
|
180
|
-
$ sf
|
|
195
|
+
$ sf project convert source --root-dir path/to/source --output-dir path/to/outputdir --package-name 'My Package'
|
|
181
196
|
|
|
182
|
-
|
|
197
|
+
FLAG DESCRIPTIONS
|
|
198
|
+
-p, --source-dir=<value>... Paths to the local source files to convert.
|
|
183
199
|
|
|
184
|
-
|
|
185
|
-
|
|
200
|
+
The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder
|
|
201
|
+
(in which case the operation is applied to all metadata types in the directory and its sub-directories).
|
|
186
202
|
|
|
187
|
-
|
|
203
|
+
If you specify this parameter, don’t specify --manifest or --metadata.
|
|
188
204
|
|
|
189
|
-
|
|
205
|
+
-x, --manifest=<value> Path to the manifest (package.xml) file that specifies the metadata types to convert.
|
|
190
206
|
|
|
191
|
-
|
|
207
|
+
If you specify this parameter, don’t specify --metadata or --source-dir.
|
|
192
208
|
|
|
193
|
-
|
|
209
|
+
--api-version=<value>
|
|
194
210
|
|
|
195
|
-
|
|
211
|
+
API Version to use in the generated project's manifest. By default, will use the version from sfdx-project.json
|
|
196
212
|
|
|
197
|
-
|
|
198
|
-
|
|
213
|
+
Override the api version used for api requests made by this command
|
|
214
|
+
```
|
|
199
215
|
|
|
200
|
-
|
|
216
|
+
_See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/convert/source.ts)_
|
|
201
217
|
|
|
202
|
-
|
|
218
|
+
## `sf project delete source`
|
|
203
219
|
|
|
204
|
-
|
|
220
|
+
Delete source from your project and from a non-source-tracked org.
|
|
205
221
|
|
|
206
|
-
|
|
222
|
+
```
|
|
223
|
+
USAGE
|
|
224
|
+
$ sf project delete source -o <value> [--json] [--api-version <value>] [-w <value>] [--tests <value> -l
|
|
225
|
+
NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg] [-r] [-m <value>] [-p <value>] [-f [-t | -c]]
|
|
226
|
+
[--verbose]
|
|
207
227
|
|
|
208
|
-
|
|
228
|
+
FLAGS
|
|
229
|
+
-c, --check-only Validate delete command but don't delete anything from the org or the local project.
|
|
230
|
+
-f, --force-overwrite Ignore conflict warnings and overwrite changes to the org.
|
|
231
|
+
-m, --metadata=<value>... Metadata components to delete.
|
|
232
|
+
-o, --target-org=<value> (required) Username or alias of the target org.
|
|
233
|
+
-p, --source-dir=<value>... Source file paths to delete.
|
|
234
|
+
-r, --no-prompt Don't prompt for delete confirmation.
|
|
235
|
+
-t, --track-source If the delete succeeds, update the source tracking information.
|
|
236
|
+
-w, --wait=<value> [default: 33 minutes] Number of minutes to wait for the command to finish.
|
|
237
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
238
|
+
--verbose Verbose output of the delete result.
|
|
239
|
+
|
|
240
|
+
TEST FLAGS
|
|
241
|
+
-l, --test-level=<option> Deployment Apex testing level.
|
|
242
|
+
<options: NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg>
|
|
243
|
+
--tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
209
244
|
|
|
210
|
-
|
|
245
|
+
GLOBAL FLAGS
|
|
246
|
+
--json Format output as json.
|
|
211
247
|
|
|
212
|
-
|
|
213
|
-
|
|
248
|
+
DESCRIPTION
|
|
249
|
+
Delete source from your project and from a non-source-tracked org.
|
|
214
250
|
|
|
215
|
-
|
|
216
|
-
|
|
251
|
+
Use this command to delete components from orgs that don’t have source tracking. To remove deleted items from orgs
|
|
252
|
+
that have source tracking enabled, "sf project deploy start".
|
|
217
253
|
|
|
218
|
-
|
|
254
|
+
When you run this command, both the local source file and the metadata component in the org are deleted.
|
|
219
255
|
|
|
220
|
-
|
|
221
|
-
|
|
256
|
+
To delete multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
|
|
257
|
+
multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
|
|
258
|
+
applies to --manifest and --source-dir.
|
|
222
259
|
|
|
223
|
-
|
|
260
|
+
ALIASES
|
|
261
|
+
$ sf force source delete
|
|
224
262
|
|
|
225
|
-
|
|
226
|
-
|
|
263
|
+
EXAMPLES
|
|
264
|
+
Delete all local Apex source files and all Apex classes from the org with alias "my-scratch":
|
|
227
265
|
|
|
228
|
-
|
|
266
|
+
$ sf project delete source --metadata ApexClass --target-org my-scratch
|
|
229
267
|
|
|
230
|
-
|
|
268
|
+
Delete a specific Apex class and a Profile that has a space in it from your default org; don't prompt for
|
|
269
|
+
confirmation:
|
|
231
270
|
|
|
232
|
-
|
|
233
|
-
|
|
271
|
+
$ sf project delete source --metadata ApexClass:MyFabulousApexClass --metadata "Profile: My Profile" --no-prompt
|
|
272
|
+
|
|
273
|
+
Run the tests that aren’t in any managed packages as part of the deletion; if the delete succeeds, and the org has
|
|
274
|
+
source-tracking enabled, update the source tracking information:
|
|
275
|
+
|
|
276
|
+
$ sf project delete source --metadata ApexClass --test-level RunLocalTests --track-source
|
|
277
|
+
|
|
278
|
+
Delete the Apex source files in a directory and the corresponding components from your default org:
|
|
279
|
+
|
|
280
|
+
$ sf project delete source --source-dir force-app/main/default/classes
|
|
281
|
+
|
|
282
|
+
FLAG DESCRIPTIONS
|
|
283
|
+
-c, --check-only Validate delete command but don't delete anything from the org or the local project.
|
|
284
|
+
|
|
285
|
+
IMPORTANT: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained
|
|
286
|
+
certain terms to avoid any effect on customer implementations.
|
|
287
|
+
|
|
288
|
+
Validates the deleted metadata and runs all Apex tests, but prevents the deletion from being saved to the org.
|
|
289
|
+
|
|
290
|
+
If you change a field type from Master-Detail to Lookup or vice versa, that change isn’t supported when using the
|
|
291
|
+
--chec-konly parameter to test a deletion (validation). This kind of change isn’t supported for test deletions to
|
|
292
|
+
avoid the risk of data loss or corruption. If a change that isn’t supported for test deletions is included in a
|
|
293
|
+
deletion package, the test deletion fails and issues an error.
|
|
294
|
+
|
|
295
|
+
If your deletion package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the
|
|
296
|
+
changes prior to deploying to Production by performing a full deletion to another test Sandbox. A full deletion
|
|
297
|
+
includes a validation of the changes as part of the deletion process.
|
|
298
|
+
|
|
299
|
+
Note: A Metadata API deletion that includes Master-Detail relationships deletes all detail records in the Recycle
|
|
300
|
+
Bin in the following cases.
|
|
301
|
+
|
|
302
|
+
1. For a deletion with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before
|
|
303
|
+
proceeding to delete the Master-Detail field, or the deletion fails. During the deletion, detail records are
|
|
304
|
+
permanently deleted from the Recycle Bin and cannot be recovered.
|
|
305
|
+
|
|
306
|
+
2. For a deletion that converts a Lookup field relationship to a Master-Detail relationship, detail records must
|
|
307
|
+
reference a master record or be soft-deleted (sent to the Recycle Bin) for the deletion to succeed. However, a
|
|
308
|
+
successful deletion permanently deletes any detail records in the Recycle Bin.
|
|
234
309
|
|
|
235
310
|
-l, --test-level=NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg Deployment Apex testing level.
|
|
236
311
|
|
|
@@ -239,9 +314,9 @@ FLAG DESCRIPTIONS
|
|
|
239
314
|
- NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as
|
|
240
315
|
sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.
|
|
241
316
|
|
|
242
|
-
- RunSpecifiedTests — Runs only the tests that you specify with the --
|
|
243
|
-
|
|
244
|
-
|
|
317
|
+
- RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ
|
|
318
|
+
from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75%
|
|
319
|
+
code coverage for each class and trigger in the deployment package. This coverage is computed for each class and
|
|
245
320
|
trigger individually and is different than the overall coverage percentage.
|
|
246
321
|
|
|
247
322
|
- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
|
|
@@ -249,50 +324,77 @@ FLAG DESCRIPTIONS
|
|
|
249
324
|
|
|
250
325
|
- RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
|
|
251
326
|
|
|
252
|
-
If you don’t specify a test level, the default behavior depends on the contents of your deployment package
|
|
253
|
-
information, see
|
|
254
|
-
Deployment](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm)
|
|
255
|
-
in the "Metadata API Developer Guide".
|
|
327
|
+
If you don’t specify a test level, the default behavior depends on the contents of your deployment package and
|
|
328
|
+
target org. For more information, see “Running Tests in a Deployment” in the Metadata API Developer Guide.
|
|
256
329
|
|
|
257
|
-
-
|
|
330
|
+
-m, --metadata=<value>... Metadata components to delete.
|
|
258
331
|
|
|
259
|
-
|
|
332
|
+
If you specify this parameter, don’t specify --source-dir.
|
|
260
333
|
|
|
261
|
-
-
|
|
334
|
+
-p, --source-dir=<value>... Source file paths to delete.
|
|
262
335
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
org.
|
|
336
|
+
The supplied paths can be a single file (in which case the operation is applied to only one file) or a folder (in
|
|
337
|
+
which case the operation is applied to all metadata types in the directory and its sub-directories).
|
|
266
338
|
|
|
267
|
-
|
|
339
|
+
If you specify this parameter, don’t specify --metadata.
|
|
268
340
|
|
|
269
|
-
|
|
270
|
-
space.
|
|
341
|
+
-w, --wait=<value> Number of minutes to wait for the command to finish.
|
|
271
342
|
|
|
272
|
-
|
|
343
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
|
|
273
344
|
|
|
274
|
-
|
|
275
|
-
returns the job ID. To resume the deployment, run "sf deploy metadata resume". To check the status of the
|
|
276
|
-
deployment, run "sf deploy metadata report".
|
|
345
|
+
--tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
277
346
|
|
|
278
|
-
|
|
347
|
+
If a test name contains a space, enclose it in double quotes.
|
|
348
|
+
For multiple test names, use one of the following formats:
|
|
279
349
|
|
|
280
|
-
|
|
350
|
+
- Repeat the flag for multiple test names: --tests Test1 --tests Test2 --tests "Test With Space"
|
|
351
|
+
- Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
|
|
352
|
+
```
|
|
281
353
|
|
|
282
|
-
|
|
354
|
+
_See code: [src/commands/project/delete/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/delete/source.ts)_
|
|
283
355
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
356
|
+
## `sf project delete tracking`
|
|
357
|
+
|
|
358
|
+
Delete all local source tracking information.
|
|
359
|
+
|
|
360
|
+
```
|
|
361
|
+
USAGE
|
|
362
|
+
$ sf project delete tracking -o <value> [--json] [--api-version <value>] [-p]
|
|
363
|
+
|
|
364
|
+
FLAGS
|
|
365
|
+
-o, --target-org=<value> (required) Username or alias of the target org.
|
|
366
|
+
-p, --no-prompt Don't prompt for source tracking override confirmation.
|
|
367
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
368
|
+
|
|
369
|
+
GLOBAL FLAGS
|
|
370
|
+
--json Format output as json.
|
|
371
|
+
|
|
372
|
+
DESCRIPTION
|
|
373
|
+
Delete all local source tracking information.
|
|
374
|
+
|
|
375
|
+
WARNING: This command deletes or overwrites all existing source tracking files. Use with extreme caution.
|
|
376
|
+
|
|
377
|
+
Deletes all local source tracking information. When you next run 'project deploy preview', Salesforce CLI displays all
|
|
378
|
+
local and remote files as changed, and any files with the same name are listed as conflicts.
|
|
379
|
+
|
|
380
|
+
ALIASES
|
|
381
|
+
$ sf force source tracking clear
|
|
382
|
+
|
|
383
|
+
EXAMPLES
|
|
384
|
+
Delete local source tracking for the org with alias "my-scratch":
|
|
385
|
+
|
|
386
|
+
$ sf project delete tracking --target-org my-scratch
|
|
287
387
|
```
|
|
288
388
|
|
|
289
|
-
|
|
389
|
+
_See code: [src/commands/project/delete/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/delete/tracking.ts)_
|
|
390
|
+
|
|
391
|
+
## `sf project deploy cancel`
|
|
290
392
|
|
|
291
393
|
Cancel a deploy operation.
|
|
292
394
|
|
|
293
395
|
```
|
|
294
396
|
USAGE
|
|
295
|
-
$ sf deploy
|
|
397
|
+
$ sf project deploy cancel [--json] [--async | -w <value>] [-i <value>] [-r]
|
|
296
398
|
|
|
297
399
|
FLAGS
|
|
298
400
|
-i, --job-id=<value> Job ID of the deploy operation you want to cancel.
|
|
@@ -312,24 +414,27 @@ DESCRIPTION
|
|
|
312
414
|
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
|
|
313
415
|
recent deploy operation.
|
|
314
416
|
|
|
417
|
+
ALIASES
|
|
418
|
+
$ sf deploy metadata cancel
|
|
419
|
+
|
|
315
420
|
EXAMPLES
|
|
316
421
|
Cancel a deploy operation using a job ID:
|
|
317
422
|
|
|
318
|
-
$ sf deploy
|
|
423
|
+
$ sf project deploy cancel --job-id 0Af0x000017yLUFCA2
|
|
319
424
|
|
|
320
425
|
Cancel the most recent deploy operation:
|
|
321
426
|
|
|
322
|
-
$ sf deploy
|
|
427
|
+
$ sf project deploy cancel --use-most-recent
|
|
323
428
|
|
|
324
429
|
FLAG DESCRIPTIONS
|
|
325
430
|
-i, --job-id=<value> Job ID of the deploy operation you want to cancel.
|
|
326
431
|
|
|
327
432
|
These commands return a job ID if they time out or you specified the --async flag:
|
|
328
433
|
|
|
329
|
-
- sf deploy
|
|
330
|
-
- sf deploy
|
|
331
|
-
- sf deploy
|
|
332
|
-
- sf deploy
|
|
434
|
+
- sf project deploy start
|
|
435
|
+
- sf project deploy validate
|
|
436
|
+
- sf project deploy quick
|
|
437
|
+
- sf project deploy cancel
|
|
333
438
|
|
|
334
439
|
The job ID is valid for 10 days from when you started the deploy operation.
|
|
335
440
|
|
|
@@ -341,29 +446,31 @@ FLAG DESCRIPTIONS
|
|
|
341
446
|
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
342
447
|
|
|
343
448
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
|
|
344
|
-
resume watching the cancellation, run "sf deploy
|
|
345
|
-
deploy
|
|
449
|
+
resume watching the cancellation, run "sf project deploy resume". To check the status of the cancellation, run "sf
|
|
450
|
+
project deploy report".
|
|
346
451
|
|
|
347
452
|
--async Run the command asynchronously.
|
|
348
453
|
|
|
349
454
|
The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To
|
|
350
|
-
resume watching the cancellation, run "sf deploy
|
|
351
|
-
deploy
|
|
455
|
+
resume watching the cancellation, run "sf project deploy resume". To check the status of the cancellation, run "sf
|
|
456
|
+
project deploy report".
|
|
352
457
|
```
|
|
353
458
|
|
|
354
|
-
|
|
459
|
+
_See code: [src/commands/project/deploy/cancel.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/deploy/cancel.ts)_
|
|
460
|
+
|
|
461
|
+
## `sf project deploy preview`
|
|
355
462
|
|
|
356
463
|
Preview a deployment to see what will deploy to the org, the potential conflicts, and the ignored files.
|
|
357
464
|
|
|
358
465
|
```
|
|
359
466
|
USAGE
|
|
360
|
-
$ sf deploy
|
|
467
|
+
$ sf project deploy preview -o <value> [--json] [-c] [-x <value> | -d <value> | -m <value>]
|
|
361
468
|
|
|
362
469
|
FLAGS
|
|
363
|
-
-c, --ignore-conflicts
|
|
470
|
+
-c, --ignore-conflicts Don't display conflicts in preview of the deployment.
|
|
364
471
|
-d, --source-dir=<value>... Path to the local source files to preview.
|
|
365
472
|
-m, --metadata=<value>... Metadata component names to preview.
|
|
366
|
-
-o, --target-org=<value> Login username or alias for the target org.
|
|
473
|
+
-o, --target-org=<value> (required) Login username or alias for the target org.
|
|
367
474
|
-x, --manifest=<value> Full file path for manifest (package.xml) of components to preview.
|
|
368
475
|
|
|
369
476
|
GLOBAL FLAGS
|
|
@@ -374,40 +481,44 @@ DESCRIPTION
|
|
|
374
481
|
|
|
375
482
|
You must run this command from within a project.
|
|
376
483
|
|
|
377
|
-
The command outputs a table that describes what will happen if you run the "sf deploy
|
|
378
|
-
lists the metadata components that will be deployed and deleted. The table also lists the current conflicts
|
|
379
|
-
files in your local project and components in the org. Finally, the table lists the files that won't be
|
|
380
|
-
because they're included in your .forceignore file.
|
|
484
|
+
The command outputs a table that describes what will happen if you run the "sf project deploy start" command. The
|
|
485
|
+
table lists the metadata components that will be deployed and deleted. The table also lists the current conflicts
|
|
486
|
+
between files in your local project and components in the org. Finally, the table lists the files that won't be
|
|
487
|
+
deployed because they're included in your .forceignore file.
|
|
381
488
|
|
|
382
|
-
If your org allows source tracking, then this command
|
|
383
|
-
as production
|
|
384
|
-
|
|
489
|
+
If your org allows source tracking, then this command displays potential conflicts between the org and your local
|
|
490
|
+
project. Some orgs, such as production org, never allow source tracking. Source tracking is enabled by default on
|
|
491
|
+
scratch and sandbox orgs; you can disable source tracking when you create the orgs by specifying the --no-track-source
|
|
492
|
+
flag on the "sf org create scratch|sandbox" commands.
|
|
385
493
|
|
|
386
494
|
To preview the deployment of multiple metadata components, either set multiple --metadata <name> flags or a single
|
|
387
495
|
--metadata flag with multiple names separated by spaces. Enclose names that contain spaces in one set of double
|
|
388
496
|
quotes. The same syntax applies to --manifest and --source-dir.
|
|
389
497
|
|
|
498
|
+
ALIASES
|
|
499
|
+
$ sf deploy metadata preview
|
|
500
|
+
|
|
390
501
|
EXAMPLES
|
|
391
|
-
NOTE: The commands to preview a deployment and actually deploy it use similar flags. We provide a few preview examples here, but see the help for "sf deploy
|
|
502
|
+
NOTE: The commands to preview a deployment and actually deploy it use similar flags. We provide a few preview examples here, but see the help for "sf project deploy start" for more examples that you can adapt for previewing.
|
|
392
503
|
|
|
393
|
-
Preview the deployment of source files in a directory, such as force-app:
|
|
504
|
+
Preview the deployment of source files in a directory, such as force-app, to your default org:
|
|
394
505
|
|
|
395
|
-
$ sf deploy
|
|
506
|
+
$ sf project deploy preview --source-dir force-app
|
|
396
507
|
|
|
397
|
-
Preview the deployment of all Apex classes:
|
|
508
|
+
Preview the deployment of all Apex classes to an org with alias "my-scratch":
|
|
398
509
|
|
|
399
|
-
$ sf deploy
|
|
510
|
+
$ sf project deploy preview --metadata ApexClass --target-org my-scratch
|
|
400
511
|
|
|
401
512
|
Preview deployment of a specific Apex class:
|
|
402
513
|
|
|
403
|
-
$ sf deploy
|
|
514
|
+
$ sf project deploy preview --metadata ApexClass:MyApexClass
|
|
404
515
|
|
|
405
516
|
Preview deployment of all components listed in a manifest:
|
|
406
517
|
|
|
407
|
-
$ sf deploy
|
|
518
|
+
$ sf project deploy preview --manifest path/to/package.xml
|
|
408
519
|
|
|
409
520
|
FLAG DESCRIPTIONS
|
|
410
|
-
-c, --ignore-conflicts
|
|
521
|
+
-c, --ignore-conflicts Don't display conflicts in preview of the deployment.
|
|
411
522
|
|
|
412
523
|
This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
|
|
413
524
|
production orgs.
|
|
@@ -428,22 +539,27 @@ FLAG DESCRIPTIONS
|
|
|
428
539
|
All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
|
|
429
540
|
```
|
|
430
541
|
|
|
431
|
-
|
|
542
|
+
_See code: [src/commands/project/deploy/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/deploy/preview.ts)_
|
|
543
|
+
|
|
544
|
+
## `sf project deploy quick`
|
|
432
545
|
|
|
433
546
|
Quickly deploy a validated deployment to an org.
|
|
434
547
|
|
|
435
548
|
```
|
|
436
549
|
USAGE
|
|
437
|
-
$ sf deploy
|
|
550
|
+
$ sf project deploy quick [--json] [--async | -w <value>] [--concise | --verbose] [-i <value>] [-o <value>] [-r] [-a
|
|
551
|
+
<value>]
|
|
438
552
|
|
|
439
553
|
FLAGS
|
|
440
|
-
-
|
|
441
|
-
-
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
--
|
|
445
|
-
|
|
446
|
-
--
|
|
554
|
+
-a, --api-version=<value> Target API version for the deploy.
|
|
555
|
+
-i, --job-id=<value> Job ID of the deployment you want to quick deploy.
|
|
556
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
557
|
+
-r, --use-most-recent Use the job ID of the most recently validated deployment.
|
|
558
|
+
-w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for the command to complete and display
|
|
559
|
+
results.
|
|
560
|
+
--async Run the command asynchronously.
|
|
561
|
+
--concise Show concise output of the deploy result.
|
|
562
|
+
--verbose Show verbose output of the deploy result.
|
|
447
563
|
|
|
448
564
|
GLOBAL FLAGS
|
|
449
565
|
--json Format output as json.
|
|
@@ -451,7 +567,7 @@ GLOBAL FLAGS
|
|
|
451
567
|
DESCRIPTION
|
|
452
568
|
Quickly deploy a validated deployment to an org.
|
|
453
569
|
|
|
454
|
-
Before you run this command, first create a validated deployment with the "sf deploy
|
|
570
|
+
Before you run this command, first create a validated deployment with the "sf project deploy validate" command, which
|
|
455
571
|
returns a job ID. Validated deployments haven't been deployed to the org yet; you deploy them with this command.
|
|
456
572
|
Either pass the job ID to this command or use the --use-most-recent flag to use the job ID of the most recently
|
|
457
573
|
validated deployment. For the quick deploy to succeed, the associated validated deployment must also have succeeded.
|
|
@@ -463,16 +579,24 @@ DESCRIPTION
|
|
|
463
579
|
This command doesn't support source-tracking. The source you deploy overwrites the corresponding metadata in your org.
|
|
464
580
|
This command doesn’t attempt to merge your source with the versions in your org.
|
|
465
581
|
|
|
582
|
+
ALIASES
|
|
583
|
+
$ sf deploy metadata quick
|
|
584
|
+
|
|
466
585
|
EXAMPLES
|
|
467
586
|
Run a quick deploy to your default org using a job ID:
|
|
468
587
|
|
|
469
|
-
$ sf deploy
|
|
588
|
+
$ sf project deploy quick --job-id 0Af0x000017yLUFCA2
|
|
470
589
|
|
|
471
590
|
Asynchronously run a quick deploy of the most recently validated deployment to an org with alias "my-prod-org":
|
|
472
591
|
|
|
473
|
-
$ sf deploy
|
|
592
|
+
$ sf project deploy quick --async --use-most-recent --target-org my-prod-org
|
|
474
593
|
|
|
475
594
|
FLAG DESCRIPTIONS
|
|
595
|
+
-a, --api-version=<value> Target API version for the deploy.
|
|
596
|
+
|
|
597
|
+
Use this flag to override the default API version with the API version of your package.xml file. The default API
|
|
598
|
+
version is the latest version supported by the CLI.
|
|
599
|
+
|
|
476
600
|
-i, --job-id=<value> Job ID of the deployment you want to quick deploy.
|
|
477
601
|
|
|
478
602
|
The job ID is valid for 10 days from when you started the validation.
|
|
@@ -489,73 +613,122 @@ FLAG DESCRIPTIONS
|
|
|
489
613
|
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
490
614
|
|
|
491
615
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
|
|
492
|
-
resume watching the deploy, run "sf deploy
|
|
493
|
-
|
|
616
|
+
resume watching the deploy, run "sf project deploy resume". To check the status of the deploy, run "sf project
|
|
617
|
+
deploy report".
|
|
494
618
|
|
|
495
619
|
--async Run the command asynchronously.
|
|
496
620
|
|
|
497
621
|
The command immediately returns the control of the terminal to you. This way, you can continue to use the CLI. To
|
|
498
|
-
resume watching the deploy, run "sf deploy
|
|
499
|
-
|
|
622
|
+
resume watching the deploy, run "sf project deploy resume". To check the status of the deploy, run "sf project
|
|
623
|
+
deploy report".
|
|
500
624
|
```
|
|
501
625
|
|
|
502
|
-
|
|
626
|
+
_See code: [src/commands/project/deploy/quick.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/deploy/quick.ts)_
|
|
503
627
|
|
|
504
|
-
|
|
628
|
+
## `sf project deploy report`
|
|
629
|
+
|
|
630
|
+
Check or poll for the status of a deploy operation.
|
|
505
631
|
|
|
506
632
|
```
|
|
507
633
|
USAGE
|
|
508
|
-
$ sf deploy
|
|
634
|
+
$ sf project deploy report [--json] [-o <value>] [-i <value>] [-r] [--coverage-formatters
|
|
635
|
+
clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
|
|
636
|
+
<value>] [-w <value>]
|
|
509
637
|
|
|
510
638
|
FLAGS
|
|
511
|
-
-i, --job-id=<value>
|
|
512
|
-
-
|
|
639
|
+
-i, --job-id=<value> Job ID of the deploy operation you want to check the status of.
|
|
640
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
641
|
+
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
642
|
+
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
643
|
+
|
|
644
|
+
TEST FLAGS
|
|
645
|
+
--coverage-formatters=<option>... Format of the code coverage results.
|
|
646
|
+
<options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|t
|
|
647
|
+
ext|text-summary>
|
|
648
|
+
--junit Output JUnit test results.
|
|
649
|
+
--results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy ID.
|
|
513
650
|
|
|
514
651
|
GLOBAL FLAGS
|
|
515
652
|
--json Format output as json.
|
|
516
653
|
|
|
517
654
|
DESCRIPTION
|
|
518
|
-
Check the status of a deploy operation.
|
|
655
|
+
Check or poll for the status of a deploy operation.
|
|
519
656
|
|
|
520
657
|
Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations.
|
|
521
658
|
|
|
522
659
|
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
|
|
523
|
-
recent deploy operation.
|
|
660
|
+
recent deploy operation. If you specify the --wait flag, the command polls for the status every second until the
|
|
661
|
+
timeout of --wait minutes. If you don't specify the --wait flag, the command simply checks and displays the status of
|
|
662
|
+
the deploy; the command doesn't poll for the status.
|
|
663
|
+
|
|
664
|
+
You typically don't specify the --target-org flag because the cached job already references the org to which you
|
|
665
|
+
deployed. But if you run this command on a computer different than the one from which you deployed, then you must
|
|
666
|
+
specify the --target-org and it must point to the same org.
|
|
667
|
+
|
|
668
|
+
This command doesn't update source tracking information.
|
|
669
|
+
|
|
670
|
+
ALIASES
|
|
671
|
+
$ sf deploy metadata report
|
|
524
672
|
|
|
525
673
|
EXAMPLES
|
|
526
674
|
Check the status using a job ID:
|
|
527
675
|
|
|
528
|
-
$ sf deploy
|
|
676
|
+
$ sf project deploy report --job-id 0Af0x000017yLUFCA2
|
|
529
677
|
|
|
530
678
|
Check the status of the most recent deploy operation:
|
|
531
679
|
|
|
532
|
-
$ sf deploy
|
|
680
|
+
$ sf project deploy report --use-most-recent
|
|
681
|
+
|
|
682
|
+
Poll for the status using a job ID and target org:
|
|
683
|
+
|
|
684
|
+
$ sf project deploy report --job-id 0Af0x000017yLUFCA2 --target-org me@my.org --wait 30
|
|
533
685
|
|
|
534
686
|
FLAG DESCRIPTIONS
|
|
535
687
|
-i, --job-id=<value> Job ID of the deploy operation you want to check the status of.
|
|
536
688
|
|
|
537
689
|
These commands return a job ID if they time out or you specified the --async flag:
|
|
538
690
|
|
|
539
|
-
- sf deploy
|
|
540
|
-
- sf deploy
|
|
541
|
-
- sf deploy
|
|
542
|
-
- sf deploy
|
|
691
|
+
- sf project deploy start
|
|
692
|
+
- sf project deploy validate
|
|
693
|
+
- sf project deploy quick
|
|
694
|
+
- sf project deploy cancel
|
|
543
695
|
|
|
544
696
|
The job ID is valid for 10 days from when you started the deploy operation.
|
|
545
697
|
|
|
698
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
699
|
+
|
|
700
|
+
Overrides your default org.
|
|
701
|
+
|
|
546
702
|
-r, --use-most-recent Use the job ID of the most recent deploy operation.
|
|
547
703
|
|
|
548
704
|
For performance reasons, this flag uses job IDs for deploy operations that started only in the past 3 days or less.
|
|
549
705
|
If your most recent operation was more than 3 days ago, this flag won't find a job ID.
|
|
706
|
+
|
|
707
|
+
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
708
|
+
|
|
709
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
|
|
710
|
+
returns the job ID. To resume the deployment, run "sf project deploy resume". To check the status of the deployment,
|
|
711
|
+
run "sf project deploy report".
|
|
712
|
+
|
|
713
|
+
--coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
|
|
714
|
+
|
|
715
|
+
Format of the code coverage results.
|
|
716
|
+
|
|
717
|
+
For multiple formatters, repeat the flag for each formatter.
|
|
718
|
+
--coverage-formatters lcov --coverage-formatters clover
|
|
550
719
|
```
|
|
551
720
|
|
|
552
|
-
|
|
721
|
+
_See code: [src/commands/project/deploy/report.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/deploy/report.ts)_
|
|
553
722
|
|
|
554
|
-
|
|
723
|
+
## `sf project deploy resume`
|
|
724
|
+
|
|
725
|
+
Resume watching a deploy operation and update source tracking when the deploy completes.
|
|
555
726
|
|
|
556
727
|
```
|
|
557
728
|
USAGE
|
|
558
|
-
$ sf deploy
|
|
729
|
+
$ sf project deploy resume [--json] [--concise | --verbose] [-i <value>] [-r] [-w <value>] [--coverage-formatters
|
|
730
|
+
clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
|
|
731
|
+
<value>]
|
|
559
732
|
|
|
560
733
|
FLAGS
|
|
561
734
|
-i, --job-id=<value> Job ID of the deploy operation you want to resume.
|
|
@@ -564,38 +737,49 @@ FLAGS
|
|
|
564
737
|
--concise Show concise output of the deploy operation result.
|
|
565
738
|
--verbose Show verbose output of the deploy operation result.
|
|
566
739
|
|
|
740
|
+
TEST FLAGS
|
|
741
|
+
--coverage-formatters=<option>... Format of the code coverage results.
|
|
742
|
+
<options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|t
|
|
743
|
+
ext|text-summary>
|
|
744
|
+
--junit Output JUnit test results.
|
|
745
|
+
--results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy ID.
|
|
746
|
+
|
|
567
747
|
GLOBAL FLAGS
|
|
568
748
|
--json Format output as json.
|
|
569
749
|
|
|
570
750
|
DESCRIPTION
|
|
571
|
-
Resume watching a deploy operation.
|
|
751
|
+
Resume watching a deploy operation and update source tracking when the deploy completes.
|
|
572
752
|
|
|
573
753
|
Use this command to resume watching a deploy operation if the original command times out or you specified the --async
|
|
574
754
|
flag. Deploy operations include standard deploys, quick deploys, deploy validations, and deploy cancellations. This
|
|
575
755
|
command doesn't resume the original operation itself, because the operation always continues after you've started it,
|
|
576
|
-
regardless of whether you're watching it or not.
|
|
756
|
+
regardless of whether you're watching it or not. When the deploy completes, source tracking information is updated as
|
|
757
|
+
needed.
|
|
577
758
|
|
|
578
759
|
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
|
|
579
760
|
recent deploy operation.
|
|
580
761
|
|
|
762
|
+
ALIASES
|
|
763
|
+
$ sf deploy metadata resume
|
|
764
|
+
|
|
581
765
|
EXAMPLES
|
|
582
766
|
Resume watching a deploy operation using a job ID:
|
|
583
767
|
|
|
584
|
-
$ sf deploy
|
|
768
|
+
$ sf project deploy resume --job-id 0Af0x000017yLUFCA2
|
|
585
769
|
|
|
586
770
|
Resume watching the most recent deploy operation:
|
|
587
771
|
|
|
588
|
-
$ sf deploy
|
|
772
|
+
$ sf project deploy resume --use-most-recent
|
|
589
773
|
|
|
590
774
|
FLAG DESCRIPTIONS
|
|
591
775
|
-i, --job-id=<value> Job ID of the deploy operation you want to resume.
|
|
592
776
|
|
|
593
777
|
These commands return a job ID if they time out or you specified the --async flag:
|
|
594
778
|
|
|
595
|
-
- sf deploy
|
|
596
|
-
- sf deploy
|
|
597
|
-
- sf deploy
|
|
598
|
-
- sf deploy
|
|
779
|
+
- sf project deploy start
|
|
780
|
+
- sf project deploy validate
|
|
781
|
+
- sf project deploy quick
|
|
782
|
+
- sf project deploy cancel
|
|
599
783
|
|
|
600
784
|
The job ID is valid for 10 days from when you started the deploy operation.
|
|
601
785
|
|
|
@@ -608,48 +792,289 @@ FLAG DESCRIPTIONS
|
|
|
608
792
|
|
|
609
793
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you. To
|
|
610
794
|
resume watching the deploy operation, run this command again. To check the status of the deploy operation, run "sf
|
|
611
|
-
deploy
|
|
795
|
+
project deploy report".
|
|
796
|
+
|
|
797
|
+
--coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
|
|
798
|
+
|
|
799
|
+
Format of the code coverage results.
|
|
800
|
+
|
|
801
|
+
For multiple formatters, repeat the flag for each formatter.
|
|
802
|
+
--coverage-formatters lcov --coverage-formatters clover
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
_See code: [src/commands/project/deploy/resume.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/deploy/resume.ts)_
|
|
806
|
+
|
|
807
|
+
## `sf project deploy start`
|
|
808
|
+
|
|
809
|
+
Deploy metadata to an org from your local project.
|
|
810
|
+
|
|
612
811
|
```
|
|
812
|
+
USAGE
|
|
813
|
+
$ sf project deploy start -o <value> [--json] [-a <value>] [--async | -w <value>] [--concise | --verbose] [--dry-run]
|
|
814
|
+
[-c] [-r] [-g] [--single-package ] [-t <value> -l NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg]
|
|
815
|
+
[--purge-on-delete [-x <value> | -d <value> | -m <value> | --metadata-dir <value>]] [--pre-destructive-changes
|
|
816
|
+
<value> ] [--post-destructive-changes <value> ] [--coverage-formatters
|
|
817
|
+
clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
|
|
818
|
+
<value>]
|
|
819
|
+
|
|
820
|
+
FLAGS
|
|
821
|
+
-a, --api-version=<value> Target API version for the deploy.
|
|
822
|
+
-c, --ignore-conflicts Ignore conflicts and deploy local files, even if they overwrite changes in the org.
|
|
823
|
+
-g, --ignore-warnings Ignore warnings and allow a deployment to complete successfully.
|
|
824
|
+
-o, --target-org=<value> (required) Login username or alias for the target org.
|
|
825
|
+
-r, --ignore-errors Ignore any errors and don’t roll back deployment.
|
|
826
|
+
-w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for command to complete and display
|
|
827
|
+
results.
|
|
828
|
+
--async Run the command asynchronously.
|
|
829
|
+
--concise Show concise output of the deploy result.
|
|
830
|
+
--dry-run Validate deploy and run Apex tests but don’t save to the org.
|
|
831
|
+
--verbose Show verbose output of the deploy result.
|
|
832
|
+
|
|
833
|
+
SOURCE FORMAT FLAGS
|
|
834
|
+
-d, --source-dir=<value>... Path to the local source files to deploy.
|
|
835
|
+
-m, --metadata=<value>... Metadata component names to deploy. Wildcards ( `*` ) supported as long as you use
|
|
836
|
+
quotes, such as `ApexClass:MyClass*`
|
|
837
|
+
-x, --manifest=<value> Full file path for manifest (package.xml) of components to deploy.
|
|
838
|
+
|
|
839
|
+
TEST FLAGS
|
|
840
|
+
-l, --test-level=<option> Deployment Apex testing level.
|
|
841
|
+
<options: NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg>
|
|
842
|
+
-t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
843
|
+
--coverage-formatters=<option>... Format of the code coverage results.
|
|
844
|
+
<options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|t
|
|
845
|
+
ext|text-summary>
|
|
846
|
+
--junit Output JUnit test results.
|
|
847
|
+
--results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy ID.
|
|
848
|
+
|
|
849
|
+
GLOBAL FLAGS
|
|
850
|
+
--json Format output as json.
|
|
851
|
+
|
|
852
|
+
METADATA API FORMAT FLAGS
|
|
853
|
+
--metadata-dir=<value> Root of directory or zip file of metadata formatted files to deploy.
|
|
854
|
+
--single-package Indicates that the metadata zip file points to a directory structure for a single package.
|
|
855
|
+
|
|
856
|
+
DELETE FLAGS
|
|
857
|
+
--post-destructive-changes=<value> File path for a manifest (destructiveChangesPost.xml) of components to delete
|
|
858
|
+
after the deploy.
|
|
859
|
+
--pre-destructive-changes=<value> File path for a manifest (destructiveChangesPre.xml) of components to delete
|
|
860
|
+
before the deploy
|
|
861
|
+
--purge-on-delete Specify that deleted components in the destructive changes manifest file are
|
|
862
|
+
immediately eligible for deletion rather than being stored in the Recycle Bin.
|
|
863
|
+
|
|
864
|
+
DESCRIPTION
|
|
865
|
+
Deploy metadata to an org from your local project.
|
|
866
|
+
|
|
867
|
+
You must run this command from within a project.
|
|
868
|
+
|
|
869
|
+
Metadata components are deployed in source format by default. Deploy them in metadata format by specifying the
|
|
870
|
+
--metadata-dir flag, which specifies the root directory or ZIP file that contains the metadata formatted files you
|
|
871
|
+
want to deploy.
|
|
872
|
+
|
|
873
|
+
If your org allows source tracking, then this command tracks the changes in your source. Some orgs, such as production
|
|
874
|
+
org, never allow source tracking. Source tracking is enabled by default on scratch and sandbox orgs; you can disable
|
|
875
|
+
source tracking when you create the orgs by specifying the --no-track-source flag on the "sf org create
|
|
876
|
+
scratch|sandbox" commands.
|
|
877
|
+
|
|
878
|
+
To deploy multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
|
|
879
|
+
multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
|
|
880
|
+
applies to --manifest and --source-dir.
|
|
881
|
+
|
|
882
|
+
ALIASES
|
|
883
|
+
$ sf deploy metadata
|
|
884
|
+
|
|
885
|
+
EXAMPLES
|
|
886
|
+
Deploy local changes not in the org; uses your default org:
|
|
887
|
+
|
|
888
|
+
$ sf project deploy start
|
|
889
|
+
|
|
890
|
+
Deploy the source files in a directory to an org with alias "my-scratch":
|
|
891
|
+
|
|
892
|
+
$ sf project deploy start --source-dir path/to/source --target-org my-scratch
|
|
893
|
+
|
|
894
|
+
Deploy a specific Apex class and the objects whose source is in a directory (both examples are equivalent):
|
|
895
|
+
|
|
896
|
+
$ sf project deploy start --source-dir path/to/apex/classes/MyClass.cls path/to/source/objects
|
|
897
|
+
$ sf project deploy start --source-dir path/to/apex/classes/MyClass.cls --source-dir path/to/source/objects
|
|
898
|
+
|
|
899
|
+
Deploy all Apex classes:
|
|
900
|
+
|
|
901
|
+
$ sf project deploy start --metadata ApexClass
|
|
902
|
+
|
|
903
|
+
Deploy a specific Apex class:
|
|
904
|
+
|
|
905
|
+
$ sf project deploy start --metadata ApexClass:MyApexClass
|
|
906
|
+
|
|
907
|
+
Deploy specific Apex classes that match a pattern; in this example, deploy Apex classes whose names contain the
|
|
908
|
+
string "MyApex":
|
|
613
909
|
|
|
614
|
-
|
|
910
|
+
$ sf project deploy start --metadata 'ApexClass:MyApex*'
|
|
911
|
+
|
|
912
|
+
Deploy all custom objects and Apex classes (both examples are equivalent):
|
|
913
|
+
|
|
914
|
+
$ sf project deploy start --metadata CustomObject ApexClass
|
|
915
|
+
$ sf project deploy start --metadata CustomObject --metadata ApexClass
|
|
916
|
+
|
|
917
|
+
Deploy all Apex classes and a profile that has a space in its name:
|
|
918
|
+
|
|
919
|
+
$ sf project deploy start --metadata ApexClass --metadata "Profile:My Profile"
|
|
920
|
+
|
|
921
|
+
Deploy all components listed in a manifest:
|
|
922
|
+
|
|
923
|
+
$ sf project deploy start --manifest path/to/package.xml
|
|
924
|
+
|
|
925
|
+
Run the tests that aren’t in any managed packages as part of a deployment:
|
|
926
|
+
|
|
927
|
+
$ sf project deploy start --metadata ApexClass --test-level RunLocalTests
|
|
928
|
+
|
|
929
|
+
FLAG DESCRIPTIONS
|
|
930
|
+
-a, --api-version=<value> Target API version for the deploy.
|
|
931
|
+
|
|
932
|
+
Use this flag to override the default API version with the API version of your package.xml file. The default API
|
|
933
|
+
version is the latest version supported by the CLI.
|
|
934
|
+
|
|
935
|
+
-c, --ignore-conflicts Ignore conflicts and deploy local files, even if they overwrite changes in the org.
|
|
936
|
+
|
|
937
|
+
This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
|
|
938
|
+
production orgs.
|
|
939
|
+
|
|
940
|
+
-d, --source-dir=<value>... Path to the local source files to deploy.
|
|
941
|
+
|
|
942
|
+
The supplied path can be to a single file (in which case the operation is applied to only one file) or to a folder
|
|
943
|
+
(in which case the operation is applied to all metadata types in the directory and its subdirectories).
|
|
944
|
+
|
|
945
|
+
If you specify this flag, don’t specify --metadata or --manifest.
|
|
946
|
+
|
|
947
|
+
-g, --ignore-warnings Ignore warnings and allow a deployment to complete successfully.
|
|
948
|
+
|
|
949
|
+
If a warning occurs and this flag is set to true, the success status of the deployment is set to true. When this
|
|
950
|
+
flag is set to false, success is set to false, and the warning is treated like an error.
|
|
951
|
+
|
|
952
|
+
-l, --test-level=NoTestRun|RunSpecifiedTests|RunLocalTests|RunAllTestsInOrg Deployment Apex testing level.
|
|
953
|
+
|
|
954
|
+
Valid values are:
|
|
955
|
+
|
|
956
|
+
- NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as
|
|
957
|
+
sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.
|
|
958
|
+
|
|
959
|
+
- RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ
|
|
960
|
+
from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75%
|
|
961
|
+
code coverage for each class and trigger in the deployment package. This coverage is computed for each class and
|
|
962
|
+
trigger individually and is different than the overall coverage percentage.
|
|
963
|
+
|
|
964
|
+
- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
|
|
965
|
+
packages. This test level is the default for production deployments that include Apex classes or triggers.
|
|
966
|
+
|
|
967
|
+
- RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
|
|
968
|
+
|
|
969
|
+
If you don’t specify a test level, the default behavior depends on the contents of your deployment package and
|
|
970
|
+
target org. For more information, see [Running Tests in a
|
|
971
|
+
Deployment](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm)
|
|
972
|
+
in the "Metadata API Developer Guide".
|
|
973
|
+
|
|
974
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
975
|
+
|
|
976
|
+
Overrides your default org.
|
|
977
|
+
|
|
978
|
+
-r, --ignore-errors Ignore any errors and don’t roll back deployment.
|
|
979
|
+
|
|
980
|
+
When deploying to a production org, keep this flag set to false (default value). When set to true, components
|
|
981
|
+
without errors are deployed and components with errors are skipped, and could result in an inconsistent production
|
|
982
|
+
org.
|
|
983
|
+
|
|
984
|
+
-t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
985
|
+
|
|
986
|
+
If a test name contains a space, enclose it in double quotes.
|
|
987
|
+
For multiple test names, use one of the following formats:
|
|
988
|
+
|
|
989
|
+
- Repeat the flag for multiple test names: --tests Test1 --tests Test2 --tests "Test With Space"
|
|
990
|
+
- Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
|
|
991
|
+
|
|
992
|
+
-w, --wait=<minutes> Number of minutes to wait for command to complete and display results.
|
|
993
|
+
|
|
994
|
+
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
|
|
995
|
+
returns the job ID. To resume the deployment, run "sf project deploy resume". To check the status of the deployment,
|
|
996
|
+
run "sf project deploy report".
|
|
997
|
+
|
|
998
|
+
-x, --manifest=<value> Full file path for manifest (package.xml) of components to deploy.
|
|
999
|
+
|
|
1000
|
+
All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
|
|
1001
|
+
|
|
1002
|
+
--async Run the command asynchronously.
|
|
1003
|
+
|
|
1004
|
+
The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the
|
|
1005
|
+
CLI. To resume the deployment, run "sf project deploy resume". To check the status of the deployment, run "sf
|
|
1006
|
+
project deploy report".
|
|
1007
|
+
|
|
1008
|
+
--coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
|
|
1009
|
+
|
|
1010
|
+
Format of the code coverage results.
|
|
1011
|
+
|
|
1012
|
+
For multiple formatters, repeat the flag for each formatter.
|
|
1013
|
+
--coverage-formatters lcov --coverage-formatters clover
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
_See code: [src/commands/project/deploy/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/deploy/start.ts)_
|
|
1017
|
+
|
|
1018
|
+
## `sf project deploy validate`
|
|
615
1019
|
|
|
616
1020
|
Validate a metadata deployment without actually executing it.
|
|
617
1021
|
|
|
618
1022
|
```
|
|
619
1023
|
USAGE
|
|
620
|
-
$ sf deploy
|
|
621
|
-
[--single-package --metadata-dir <value>] [-
|
|
622
|
-
|
|
1024
|
+
$ sf project deploy validate -o <value> [--json] [-a <value>] [--async] [--concise | --verbose] [-m <value>] [-d <value>]
|
|
1025
|
+
[--single-package --metadata-dir <value>] [-t <value> -l RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests] [-w
|
|
1026
|
+
<value>] [--coverage-formatters
|
|
1027
|
+
clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary] [--junit] [--results-dir
|
|
1028
|
+
<value>] [--purge-on-delete -x <value>] [--pre-destructive-changes <value> ] [--post-destructive-changes <value> ]
|
|
623
1029
|
|
|
624
1030
|
FLAGS
|
|
625
|
-
-a, --api-version=<value>
|
|
1031
|
+
-a, --api-version=<value> Target API version for the validation.
|
|
1032
|
+
-o, --target-org=<value> (required) Login username or alias for the target org.
|
|
1033
|
+
-w, --wait=<minutes> [default: 33 minutes] Number of minutes to wait for the command to complete and display
|
|
1034
|
+
results.
|
|
1035
|
+
--async Run the command asynchronously.
|
|
1036
|
+
--concise Show concise output of the validation result.
|
|
1037
|
+
--verbose Show verbose output of the validation result.
|
|
1038
|
+
|
|
1039
|
+
SOURCE FORMAT FLAGS
|
|
626
1040
|
-d, --source-dir=<value>... Path to the local source files to validate for deployment.
|
|
627
|
-
-l, --test-level=<option> [default: RunLocalTests] Deployment Apex testing level.
|
|
628
|
-
<options: RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests>
|
|
629
1041
|
-m, --metadata=<value>... Metadata component names to validate for deployment.
|
|
630
|
-
-o, --target-org=<value> Login username or alias for the target org.
|
|
631
|
-
-t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
632
|
-
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
633
1042
|
-x, --manifest=<value> Full file path for manifest (package.xml) of components to validate for deployment.
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
--
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
--
|
|
1043
|
+
|
|
1044
|
+
TEST FLAGS
|
|
1045
|
+
-l, --test-level=<option> [default: RunLocalTests] Deployment Apex testing level.
|
|
1046
|
+
<options: RunAllTestsInOrg|RunLocalTests|RunSpecifiedTests>
|
|
1047
|
+
-t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
1048
|
+
--coverage-formatters=<option>... Format of the code coverage results.
|
|
1049
|
+
<options: clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|t
|
|
1050
|
+
ext|text-summary>
|
|
1051
|
+
--junit Output JUnit test results.
|
|
1052
|
+
--results-dir=<value> Output directory for code coverage and JUnit results; defaults to the deploy ID.
|
|
640
1053
|
|
|
641
1054
|
GLOBAL FLAGS
|
|
642
1055
|
--json Format output as json.
|
|
643
1056
|
|
|
1057
|
+
METADATA API FORMAT FLAGS
|
|
1058
|
+
--metadata-dir=<value> Root of directory or zip file of metadata formatted files to deploy.
|
|
1059
|
+
--single-package Indicates that the metadata zip file points to a directory structure for a single package.
|
|
1060
|
+
|
|
1061
|
+
DELETE FLAGS
|
|
1062
|
+
--post-destructive-changes=<value> File path for a manifest (destructiveChangesPost.xml) of components to delete
|
|
1063
|
+
after the deploy.
|
|
1064
|
+
--pre-destructive-changes=<value> File path for a manifest (destructiveChangesPre.xml) of components to delete
|
|
1065
|
+
before the deploy
|
|
1066
|
+
--purge-on-delete Specify that deleted components in the destructive changes manifest file are
|
|
1067
|
+
immediately eligible for deletion rather than being stored in the Recycle Bin.
|
|
1068
|
+
|
|
644
1069
|
DESCRIPTION
|
|
645
1070
|
Validate a metadata deployment without actually executing it.
|
|
646
1071
|
|
|
647
1072
|
Use this command to verify whether a deployment will succeed without actually deploying the metadata to your org. This
|
|
648
|
-
command is similar to "sf deploy
|
|
649
|
-
rather than executing the deployment. If the validation succeeds, then you pass this job ID to the "sf
|
|
650
|
-
quick" command to actually deploy the metadata. This quick deploy takes less time because it skips running Apex
|
|
651
|
-
The job ID is valid for 10 days from when you started the validation. Validating first is useful if the
|
|
652
|
-
your production org take several hours and you don’t want to risk a failed deploy.
|
|
1073
|
+
command is similar to "sf project deploy start", except you're required to run Apex tests, and the command returns a
|
|
1074
|
+
job ID rather than executing the deployment. If the validation succeeds, then you pass this job ID to the "sf project
|
|
1075
|
+
deploy quick" command to actually deploy the metadata. This quick deploy takes less time because it skips running Apex
|
|
1076
|
+
tests. The job ID is valid for 10 days from when you started the validation. Validating first is useful if the
|
|
1077
|
+
deployment to your production org take several hours and you don’t want to risk a failed deploy.
|
|
653
1078
|
|
|
654
1079
|
You must run this command from within a project.
|
|
655
1080
|
|
|
@@ -660,22 +1085,25 @@ DESCRIPTION
|
|
|
660
1085
|
--metadata flag with multiple names separated by spaces. Enclose names that contain spaces in one set of double
|
|
661
1086
|
quotes. The same syntax applies to --manifest and --source-dir.
|
|
662
1087
|
|
|
1088
|
+
ALIASES
|
|
1089
|
+
$ sf deploy metadata validate
|
|
1090
|
+
|
|
663
1091
|
EXAMPLES
|
|
664
|
-
NOTE: These examples focus on validating large deployments. See the help for "sf deploy
|
|
1092
|
+
NOTE: These examples focus on validating large deployments. See the help for "sf project deploy start" for examples of deploying smaller sets of metadata which you can also use to validate.
|
|
665
1093
|
|
|
666
1094
|
Validate the deployment of all source files in a directory to the default org:
|
|
667
1095
|
|
|
668
|
-
$ sf deploy
|
|
1096
|
+
$ sf project deploy validate --source-dir path/to/source
|
|
669
1097
|
|
|
670
1098
|
Asynchronously validate the deployment and run all tests in the org with alias "my-prod-org"; command immediately
|
|
671
1099
|
returns the job ID:
|
|
672
1100
|
|
|
673
|
-
$ sf deploy
|
|
1101
|
+
$ sf project deploy validate --source-dir path/to/source --async --test-level RunAllTestsInOrg --target-org \
|
|
674
1102
|
my-prod-org
|
|
675
1103
|
|
|
676
1104
|
Validate the deployment of all components listed in a manifest:
|
|
677
1105
|
|
|
678
|
-
$ sf deploy
|
|
1106
|
+
$ sf project deploy validate --manifest path/to/package.xml
|
|
679
1107
|
|
|
680
1108
|
FLAG DESCRIPTIONS
|
|
681
1109
|
-a, --api-version=<value> Target API version for the validation.
|
|
@@ -694,30 +1122,33 @@ FLAG DESCRIPTIONS
|
|
|
694
1122
|
|
|
695
1123
|
Valid values are:
|
|
696
1124
|
|
|
697
|
-
- RunSpecifiedTests — Runs only the tests that you specify with the --
|
|
698
|
-
|
|
699
|
-
|
|
1125
|
+
- RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ
|
|
1126
|
+
from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75%
|
|
1127
|
+
code coverage for each class and trigger in the deployment package. This coverage is computed for each class and
|
|
700
1128
|
trigger individually and is different than the overall coverage percentage.
|
|
701
1129
|
|
|
702
1130
|
- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked
|
|
703
|
-
packages. This test level is the default
|
|
1131
|
+
packages. This test level is the default.
|
|
704
1132
|
|
|
705
1133
|
- RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
|
|
706
1134
|
|
|
707
|
-
If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more
|
|
708
|
-
information, see [Running Tests in a
|
|
709
|
-
Deployment](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_running_tests.htm)
|
|
710
|
-
in the "Metadata API Developer Guide".
|
|
711
|
-
|
|
712
1135
|
-o, --target-org=<value> Login username or alias for the target org.
|
|
713
1136
|
|
|
714
1137
|
Overrides your default org.
|
|
715
1138
|
|
|
1139
|
+
-t, --tests=<value>... Apex tests to run when --test-level is RunSpecifiedTests.
|
|
1140
|
+
|
|
1141
|
+
If a test name contains a space, enclose it in double quotes.
|
|
1142
|
+
For multiple test names, use one of the following formats:
|
|
1143
|
+
|
|
1144
|
+
- Repeat the flag for multiple test names: --tests Test1 --tests Test2 --tests "Test With Space"
|
|
1145
|
+
- Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
|
|
1146
|
+
|
|
716
1147
|
-w, --wait=<minutes> Number of minutes to wait for the command to complete and display results.
|
|
717
1148
|
|
|
718
1149
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you and
|
|
719
|
-
returns the job ID. To resume watching the validation, run "sf deploy
|
|
720
|
-
validation, run "sf deploy
|
|
1150
|
+
returns the job ID. To resume watching the validation, run "sf project deploy resume". To check the status of the
|
|
1151
|
+
validation, run "sf project deploy report".
|
|
721
1152
|
|
|
722
1153
|
-x, --manifest=<value> Full file path for manifest (package.xml) of components to validate for deployment.
|
|
723
1154
|
|
|
@@ -726,31 +1157,262 @@ FLAG DESCRIPTIONS
|
|
|
726
1157
|
--async Run the command asynchronously.
|
|
727
1158
|
|
|
728
1159
|
The command immediately returns the job ID and control of the terminal to you. This way, you can continue to use the
|
|
729
|
-
CLI. To resume watching the validation, run "sf deploy
|
|
730
|
-
"sf deploy
|
|
1160
|
+
CLI. To resume watching the validation, run "sf project deploy resume". To check the status of the validation, run
|
|
1161
|
+
"sf project deploy report".
|
|
1162
|
+
|
|
1163
|
+
--coverage-formatters=clover|cobertura|html-spa|html|json|json-summary|lcovonly|none|teamcity|text|text-summary...
|
|
1164
|
+
|
|
1165
|
+
Format of the code coverage results.
|
|
1166
|
+
|
|
1167
|
+
For multiple formatters, repeat the flag for each formatter.
|
|
1168
|
+
--coverage-formatters lcov --coverage-formatters clover
|
|
731
1169
|
```
|
|
732
1170
|
|
|
733
|
-
|
|
1171
|
+
_See code: [src/commands/project/deploy/validate.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/deploy/validate.ts)_
|
|
1172
|
+
|
|
1173
|
+
## `sf project generate manifest`
|
|
1174
|
+
|
|
1175
|
+
Create a project manifest that lists the metadata components you want to deploy or retrieve.
|
|
1176
|
+
|
|
1177
|
+
```
|
|
1178
|
+
USAGE
|
|
1179
|
+
$ sf project generate manifest [--json] [--api-version <value>] [-m <value>] [-p <value>] [-n <value> | -t
|
|
1180
|
+
pre|post|destroy|package] [-c managed|unlocked --from-org <value>] [-d <value>]
|
|
1181
|
+
|
|
1182
|
+
FLAGS
|
|
1183
|
+
-c, --include-packages=<option>... Package types (managed, unlocked) whose metadata is included in the manifest; by
|
|
1184
|
+
default, metadata in packages is ignored.
|
|
1185
|
+
<options: managed|unlocked>
|
|
1186
|
+
-d, --output-dir=<value> Directory to save the created manifest.
|
|
1187
|
+
-m, --metadata=<value>... Names of metadata components to include in the manifest.
|
|
1188
|
+
-n, --name=<value> Name of a custom manifest file to create.
|
|
1189
|
+
-p, --source-dir=<value>... Paths to the local source files to include in the manifest.
|
|
1190
|
+
-t, --type=<option> Type of manifest to create; the type determines the name of the created file.
|
|
1191
|
+
<options: pre|post|destroy|package>
|
|
1192
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
1193
|
+
--from-org=<value> Username or alias of the org that contains the metadata components from which to
|
|
1194
|
+
build a manifest.
|
|
1195
|
+
|
|
1196
|
+
GLOBAL FLAGS
|
|
1197
|
+
--json Format output as json.
|
|
1198
|
+
|
|
1199
|
+
DESCRIPTION
|
|
1200
|
+
Create a project manifest that lists the metadata components you want to deploy or retrieve.
|
|
1201
|
+
|
|
1202
|
+
Create a manifest from a list of metadata components (--metadata) or from one or more local directories that contain
|
|
1203
|
+
source files (--source-dir). You can specify either of these parameters, not both.
|
|
1204
|
+
|
|
1205
|
+
Use --type to specify the type of manifest you want to create. The resulting manifest files have specific names, such
|
|
1206
|
+
as the standard package.xml or destructiveChanges.xml to delete metadata. Valid values for this parameter, and their
|
|
1207
|
+
respective file names, are:
|
|
1208
|
+
|
|
1209
|
+
* package : package.xml (default)
|
|
1210
|
+
* pre : destructiveChangesPre.xml
|
|
1211
|
+
* post : destructiveChangesPost.xml
|
|
1212
|
+
* destroy : destructiveChanges.xml
|
|
1213
|
+
|
|
1214
|
+
See https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy_deleting_files.htm for
|
|
1215
|
+
information about these destructive manifest files.
|
|
1216
|
+
|
|
1217
|
+
Use --name to specify a custom name for the generated manifest if the pre-defined ones don’t suit your needs. You can
|
|
1218
|
+
specify either --type or --name, but not both.
|
|
1219
|
+
|
|
1220
|
+
To include multiple metadata components, either set multiple --metadata <name> flags or a single --metadata flag with
|
|
1221
|
+
multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same syntax
|
|
1222
|
+
applies to --include-packages and --source-dir.
|
|
1223
|
+
|
|
1224
|
+
ALIASES
|
|
1225
|
+
$ sf force source manifest create
|
|
1226
|
+
|
|
1227
|
+
EXAMPLES
|
|
1228
|
+
Create a manifest for deploying or retrieving all Apex classes and custom objects:
|
|
1229
|
+
|
|
1230
|
+
$ sf project generate manifest --metadata ApexClass --metadata CustomObject
|
|
1231
|
+
|
|
1232
|
+
Create a manifest for deleting the specified Apex class:
|
|
1233
|
+
|
|
1234
|
+
$ sf project generate manifest --metadata ApexClass:MyApexClass --type destroy
|
|
1235
|
+
|
|
1236
|
+
Create a manifest for deploying or retrieving all the metadata components in the specified local directory; name the
|
|
1237
|
+
file myNewManifest.xml:
|
|
1238
|
+
|
|
1239
|
+
$ sf project generate manifest --source-dir force-app --name myNewManifest
|
|
1240
|
+
|
|
1241
|
+
Create a manifest from the metadata components in the specified org and include metadata in any unlocked packages:
|
|
1242
|
+
|
|
1243
|
+
$ sf project generate manifest --from-org test@myorg.com --include-packages unlocked
|
|
1244
|
+
```
|
|
1245
|
+
|
|
1246
|
+
_See code: [src/commands/project/generate/manifest.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/generate/manifest.ts)_
|
|
1247
|
+
|
|
1248
|
+
## `sf project list ignored`
|
|
1249
|
+
|
|
1250
|
+
Check your local project package directories for forceignored files.
|
|
1251
|
+
|
|
1252
|
+
```
|
|
1253
|
+
USAGE
|
|
1254
|
+
$ sf project list ignored [--json] [-p <value>]
|
|
1255
|
+
|
|
1256
|
+
FLAGS
|
|
1257
|
+
-p, --source-dir=<value> File or directory of files that the command checks for foreceignored files.
|
|
1258
|
+
|
|
1259
|
+
GLOBAL FLAGS
|
|
1260
|
+
--json Format output as json.
|
|
1261
|
+
|
|
1262
|
+
DESCRIPTION
|
|
1263
|
+
Check your local project package directories for forceignored files.
|
|
1264
|
+
|
|
1265
|
+
When deploying or retrieving metadata between your local project and an org, you can specify the source files you want
|
|
1266
|
+
to exclude with a .forceignore file. The .forceignore file structure mimics the .gitignore structure. Each line in
|
|
1267
|
+
.forceignore specifies a pattern that corresponds to one or more files. The files typically represent metadata
|
|
1268
|
+
components, but can be any files you want to exclude, such as LWC configuration JSON files or tests.
|
|
1269
|
+
|
|
1270
|
+
ALIASES
|
|
1271
|
+
$ sf force source ignored list
|
|
1272
|
+
|
|
1273
|
+
EXAMPLES
|
|
1274
|
+
List all the files in all package directories that are ignored:
|
|
1275
|
+
|
|
1276
|
+
$ sf project list ignored
|
|
1277
|
+
|
|
1278
|
+
List all the files in a specific directory that are ignored:
|
|
1279
|
+
|
|
1280
|
+
$ sf project list ignored --source-dir force-app
|
|
1281
|
+
|
|
1282
|
+
Check if a particular file is ignored:
|
|
1283
|
+
|
|
1284
|
+
$ sf project list ignored --source-dir package.xml
|
|
1285
|
+
```
|
|
1286
|
+
|
|
1287
|
+
_See code: [src/commands/project/list/ignored.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/list/ignored.ts)_
|
|
1288
|
+
|
|
1289
|
+
## `sf project reset tracking`
|
|
1290
|
+
|
|
1291
|
+
Reset local and remote source tracking.
|
|
1292
|
+
|
|
1293
|
+
```
|
|
1294
|
+
USAGE
|
|
1295
|
+
$ sf project reset tracking -o <value> [--json] [--api-version <value>] [-r <value>] [-p]
|
|
1296
|
+
|
|
1297
|
+
FLAGS
|
|
1298
|
+
-o, --target-org=<value> (required) Username or alias of the target org.
|
|
1299
|
+
-p, --no-prompt Don't prompt for source tracking override confirmation.
|
|
1300
|
+
-r, --revision=<value> SourceMember revision counter number to reset to.
|
|
1301
|
+
--api-version=<value> Override the api version used for api requests made by this command
|
|
1302
|
+
|
|
1303
|
+
GLOBAL FLAGS
|
|
1304
|
+
--json Format output as json.
|
|
1305
|
+
|
|
1306
|
+
DESCRIPTION
|
|
1307
|
+
Reset local and remote source tracking.
|
|
1308
|
+
|
|
1309
|
+
WARNING: This command deletes or overwrites all existing source tracking files. Use with extreme caution.
|
|
1310
|
+
|
|
1311
|
+
Resets local and remote source tracking so that Salesforce CLI no longer registers differences between your local
|
|
1312
|
+
files and those in the org. When you next run 'project deploy preview', Salesforce CLI returns no results, even though
|
|
1313
|
+
conflicts might actually exist. Salesforce CLI then resumes tracking new source changes as usual.
|
|
1314
|
+
|
|
1315
|
+
Use the --revision parameter to reset source tracking to a specific revision number of an org source member. To get
|
|
1316
|
+
the revision number, query the SourceMember Tooling API object with the 'data soql' command. For example:
|
|
1317
|
+
|
|
1318
|
+
sf data query --query "SELECT MemberName, MemberType, RevisionCounter FROM SourceMember" --use-tooling-api
|
|
1319
|
+
--target-org my-scratch
|
|
1320
|
+
|
|
1321
|
+
ALIASES
|
|
1322
|
+
$ sf force source tracking reset
|
|
1323
|
+
|
|
1324
|
+
EXAMPLES
|
|
1325
|
+
Reset source tracking for the org with alias "my-scratch":
|
|
1326
|
+
|
|
1327
|
+
$ sf project reset tracking --target-org my-scratch
|
|
1328
|
+
|
|
1329
|
+
Reset source tracking to revision number 30 for your default org:
|
|
1330
|
+
|
|
1331
|
+
$ sf project reset tracking --revision 30
|
|
1332
|
+
```
|
|
1333
|
+
|
|
1334
|
+
_See code: [src/commands/project/reset/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/reset/tracking.ts)_
|
|
1335
|
+
|
|
1336
|
+
## `sf project retrieve preview`
|
|
1337
|
+
|
|
1338
|
+
Preview a retrieval to see what will be retrieved from the org, the potential conflicts, and the ignored files.
|
|
1339
|
+
|
|
1340
|
+
```
|
|
1341
|
+
USAGE
|
|
1342
|
+
$ sf project retrieve preview -o <value> [--json] [-c]
|
|
1343
|
+
|
|
1344
|
+
FLAGS
|
|
1345
|
+
-c, --ignore-conflicts Don't display conflicts in the preview of the retrieval.
|
|
1346
|
+
-o, --target-org=<value> (required) Login username or alias for the target org.
|
|
1347
|
+
|
|
1348
|
+
GLOBAL FLAGS
|
|
1349
|
+
--json Format output as json.
|
|
1350
|
+
|
|
1351
|
+
DESCRIPTION
|
|
1352
|
+
Preview a retrieval to see what will be retrieved from the org, the potential conflicts, and the ignored files.
|
|
1353
|
+
|
|
1354
|
+
You must run this command from within a project.
|
|
1355
|
+
|
|
1356
|
+
The command outputs a table that describes what will happen if you run the "sf project retrieve start" command. The
|
|
1357
|
+
table lists the metadata components that will be retrieved and deleted. The table also lists the current conflicts
|
|
1358
|
+
between files in your local project and components in the org. Finally, the table lists the files that won't be
|
|
1359
|
+
retrieved because they're included in your .forceignore file.
|
|
1360
|
+
|
|
1361
|
+
If your org allows source tracking, then this command displays potential conflicts between the org and your local
|
|
1362
|
+
project. Some orgs, such as production org, never allow source tracking. Source tracking is enabled by default on
|
|
1363
|
+
scratch and sandbox orgs; you can disable source tracking when you create the orgs by specifying the --no-track-source
|
|
1364
|
+
flag on the "sf org create scratch|sandbox" commands.
|
|
1365
|
+
|
|
1366
|
+
ALIASES
|
|
1367
|
+
$ sf retrieve metadata preview
|
|
1368
|
+
|
|
1369
|
+
EXAMPLES
|
|
1370
|
+
Preview the retrieve of all changes from your default org:
|
|
1371
|
+
|
|
1372
|
+
$ sf project retrieve preview
|
|
1373
|
+
|
|
1374
|
+
Preview the retrieve when ignoring any conflicts from an org with alias "my-scratch":
|
|
1375
|
+
|
|
1376
|
+
$ sf project retrieve preview --ignore-conflicts --target-org my-scratch
|
|
1377
|
+
|
|
1378
|
+
FLAG DESCRIPTIONS
|
|
1379
|
+
-c, --ignore-conflicts Don't display conflicts in the preview of the retrieval.
|
|
1380
|
+
|
|
1381
|
+
This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
|
|
1382
|
+
production orgs.
|
|
1383
|
+
|
|
1384
|
+
-o, --target-org=<value> Login username or alias for the target org.
|
|
1385
|
+
|
|
1386
|
+
Overrides your default org.
|
|
1387
|
+
```
|
|
1388
|
+
|
|
1389
|
+
_See code: [src/commands/project/retrieve/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/retrieve/preview.ts)_
|
|
1390
|
+
|
|
1391
|
+
## `sf project retrieve start`
|
|
734
1392
|
|
|
735
1393
|
Retrieve metadata from an org to your local project.
|
|
736
1394
|
|
|
737
1395
|
```
|
|
738
1396
|
USAGE
|
|
739
|
-
$ sf retrieve
|
|
740
|
-
[--single-package -t <value>] [-
|
|
1397
|
+
$ sf project retrieve start -o <value> [--json] [-a <value>] [-c] [-x <value> | -m <value> | -d <value>] [-r <value> | -n
|
|
1398
|
+
<value> | ] [--single-package -t <value>] [-w <value>] [-z ] [--zip-file-name <value> ]
|
|
741
1399
|
|
|
742
1400
|
FLAGS
|
|
743
|
-
-a, --api-version=<value>
|
|
744
|
-
-c, --ignore-conflicts
|
|
745
|
-
|
|
746
|
-
-d, --source-dir=<value>...
|
|
747
|
-
-m, --metadata=<value>...
|
|
748
|
-
|
|
749
|
-
-
|
|
1401
|
+
-a, --api-version=<value> Target API version for the retrieve.
|
|
1402
|
+
-c, --ignore-conflicts Ignore conflicts and retrieve and save files to your local filesystem, even if they
|
|
1403
|
+
overwrite your local changes.
|
|
1404
|
+
-d, --source-dir=<value>... File paths for source to retrieve from the org.
|
|
1405
|
+
-m, --metadata=<value>... Metadata component names to retrieve. Wildcards ( `*` ) supported as long as you use
|
|
1406
|
+
quotes, such as `ApexClass:MyClass*`
|
|
1407
|
+
-n, --package-name=<value>... Package names to retrieve.
|
|
1408
|
+
-o, --target-org=<value> (required) Login username or alias for the target org.
|
|
1409
|
+
-r, --output-dir=<value> Directory root for the retrieved source files.
|
|
1410
|
+
-w, --wait=<value> [default: 33 minutes] Number of minutes to wait for the command to complete and display
|
|
1411
|
+
results to the terminal window.
|
|
1412
|
+
-x, --manifest=<value> File path for the manifest (package.xml) that specifies the components to retrieve.
|
|
1413
|
+
|
|
1414
|
+
METADATA API FORMAT FLAGS
|
|
750
1415
|
-t, --target-metadata-dir=<value> Directory that will contain the retrieved metadata format files or ZIP.
|
|
751
|
-
-w, --wait=<value> Number of minutes to wait for the command to complete and display results to the
|
|
752
|
-
terminal window.
|
|
753
|
-
-x, --manifest=<value> File path for the manifest (package.xml) that specifies the components to retrieve.
|
|
754
1416
|
-z, --unzip Extract all files from the retrieved zip file.
|
|
755
1417
|
--single-package Indicates that the zip file points to a directory structure for a single package.
|
|
756
1418
|
--zip-file-name=<value> File name to use for the retrieved zip file.
|
|
@@ -767,61 +1429,71 @@ DESCRIPTION
|
|
|
767
1429
|
--target-metadata-dir flag, which retrieves the components into a ZIP file in the specified directory.
|
|
768
1430
|
|
|
769
1431
|
If your org allows source tracking, then this command tracks the changes in your source. Some orgs, such as production
|
|
770
|
-
org, never allow source tracking.
|
|
771
|
-
|
|
1432
|
+
org, never allow source tracking. Source tracking is enabled by default on scratch and sandbox orgs; you can disable
|
|
1433
|
+
source tracking when you create the orgs by specifying the --no-track-source flag on the "sf org create
|
|
1434
|
+
scratch|sandbox" commands.
|
|
772
1435
|
|
|
773
1436
|
To retrieve multiple metadata components, either use multiple --metadata <name> flags or use a single --metadata flag
|
|
774
1437
|
with multiple names separated by spaces. Enclose names that contain spaces in one set of double quotes. The same
|
|
775
1438
|
syntax applies to --manifest and --source-dir.
|
|
776
1439
|
|
|
1440
|
+
ALIASES
|
|
1441
|
+
$ sf retrieve metadata
|
|
1442
|
+
|
|
777
1443
|
EXAMPLES
|
|
778
|
-
Retrieve remote changes:
|
|
1444
|
+
Retrieve remote changes from your default org:
|
|
779
1445
|
|
|
780
|
-
$ sf retrieve
|
|
1446
|
+
$ sf project retrieve start
|
|
781
1447
|
|
|
782
|
-
Retrieve the source files in a directory:
|
|
1448
|
+
Retrieve the source files in a directory from an org with alias "my-scratch":
|
|
783
1449
|
|
|
784
|
-
$ sf retrieve
|
|
1450
|
+
$ sf project retrieve start --source-dir path/to/source --target-org my-scratch
|
|
785
1451
|
|
|
786
1452
|
Retrieve a specific Apex class and the objects whose source is in a directory (both examples are equivalent):
|
|
787
1453
|
|
|
788
|
-
$ sf retrieve
|
|
789
|
-
$ sf retrieve
|
|
1454
|
+
$ sf project retrieve start --source-dir path/to/apex/classes/MyClass.cls path/to/source/objects
|
|
1455
|
+
$ sf project retrieve start --source-dir path/to/apex/classes/MyClass.cls --source-dir path/to/source/objects
|
|
790
1456
|
|
|
791
1457
|
Retrieve all Apex classes:
|
|
792
1458
|
|
|
793
|
-
$ sf retrieve
|
|
1459
|
+
$ sf project retrieve start --metadata ApexClass
|
|
794
1460
|
|
|
795
1461
|
Retrieve a specific Apex class:
|
|
796
1462
|
|
|
797
|
-
$ sf retrieve
|
|
1463
|
+
$ sf project retrieve start --metadata ApexClass:MyApexClass
|
|
1464
|
+
|
|
1465
|
+
Retrieve specific Apex classes that match a pattern; in this example, retrieve Apex classes whose names contain the
|
|
1466
|
+
string "MyApex":
|
|
1467
|
+
|
|
1468
|
+
$ sf project retrieve start --metadata 'ApexClass:MyApex*'
|
|
798
1469
|
|
|
799
1470
|
Retrieve all custom objects and Apex classes (both examples are equivalent):
|
|
800
1471
|
|
|
801
|
-
$ sf retrieve
|
|
802
|
-
$ sf retrieve
|
|
1472
|
+
$ sf project retrieve start --metadata CustomObject ApexClass
|
|
1473
|
+
$ sf project retrieve start --metadata CustomObject --metadata ApexClass
|
|
803
1474
|
|
|
804
1475
|
Retrieve all metadata components listed in a manifest:
|
|
805
1476
|
|
|
806
|
-
$ sf retrieve
|
|
1477
|
+
$ sf project retrieve start --manifest path/to/package.xml
|
|
807
1478
|
|
|
808
1479
|
Retrieve metadata from a package:
|
|
809
1480
|
|
|
810
|
-
$ sf retrieve
|
|
1481
|
+
$ sf project retrieve start --package-name MyPackageName
|
|
811
1482
|
|
|
812
1483
|
Retrieve metadata from multiple packages, one of which has a space in its name (both examples are equivalent):
|
|
813
1484
|
|
|
814
|
-
$ sf retrieve
|
|
815
|
-
$ sf retrieve
|
|
1485
|
+
$ sf project retrieve start --package-name Package1 "PackageName With Spaces" Package3
|
|
1486
|
+
$ sf project retrieve start --package-name Package1 --package-name "PackageName With Spaces" --package-name \
|
|
1487
|
+
Package3
|
|
816
1488
|
|
|
817
1489
|
Retrieve the metadata components listed in the force-app directory, but retrieve them in metadata format into a ZIP
|
|
818
1490
|
file in the "output" directory:
|
|
819
1491
|
|
|
820
|
-
$ sf retrieve
|
|
1492
|
+
$ sf project retrieve start --source-dir force-app --target-metadata-dir output
|
|
821
1493
|
|
|
822
1494
|
Retrieve in metadata format and automatically extract the contents into the "output" directory:
|
|
823
1495
|
|
|
824
|
-
$ sf retrieve
|
|
1496
|
+
$ sf project retrieve start --source-dir force-app --target-metadata-dir output --unzip
|
|
825
1497
|
|
|
826
1498
|
FLAG DESCRIPTIONS
|
|
827
1499
|
-a, --api-version=<value> Target API version for the retrieve.
|
|
@@ -845,6 +1517,12 @@ FLAG DESCRIPTIONS
|
|
|
845
1517
|
|
|
846
1518
|
Overrides your default org.
|
|
847
1519
|
|
|
1520
|
+
-r, --output-dir=<value> Directory root for the retrieved source files.
|
|
1521
|
+
|
|
1522
|
+
The root of the directory structure into which the source files are retrieved.
|
|
1523
|
+
If the target directory matches one of the package directories in your sfdx-project.json file, the command fails.
|
|
1524
|
+
Running the command multiple times with the same target adds new files and overwrites existing files.
|
|
1525
|
+
|
|
848
1526
|
-w, --wait=<value> Number of minutes to wait for the command to complete and display results to the terminal window.
|
|
849
1527
|
|
|
850
1528
|
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
|
|
@@ -854,56 +1532,6 @@ FLAG DESCRIPTIONS
|
|
|
854
1532
|
If you specify this parameter, don’t specify --metadata or --source-dir.
|
|
855
1533
|
```
|
|
856
1534
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
Preview a retrieval to see what will be retrieved from the org, the potential conflicts, and the ignored files.
|
|
860
|
-
|
|
861
|
-
```
|
|
862
|
-
USAGE
|
|
863
|
-
$ sf retrieve metadata preview [--json] [-c] [-o <value>]
|
|
864
|
-
|
|
865
|
-
FLAGS
|
|
866
|
-
-c, --ignore-conflicts Ignore conflicts and preview the retrieve of remote components, even if they will overwrite
|
|
867
|
-
local changes.
|
|
868
|
-
-o, --target-org=<value> Login username or alias for the target org.
|
|
869
|
-
|
|
870
|
-
GLOBAL FLAGS
|
|
871
|
-
--json Format output as json.
|
|
872
|
-
|
|
873
|
-
DESCRIPTION
|
|
874
|
-
Preview a retrieval to see what will be retrieved from the org, the potential conflicts, and the ignored files.
|
|
875
|
-
|
|
876
|
-
You must run this command from within a project.
|
|
877
|
-
|
|
878
|
-
The command outputs a table that describes what will happen if you run the "sf retrieve metadata" command. The table
|
|
879
|
-
lists the metadata components that will be retrieved and deleted. The table also lists the current conflicts between
|
|
880
|
-
files in your local project and components in the org. Finally, the table lists the files that won't be retrieved
|
|
881
|
-
because they're included in your .forceignore file.
|
|
882
|
-
|
|
883
|
-
If your org allows source tracking, then this command considers conflicts between the org and local. Some orgs, such
|
|
884
|
-
as production orgs, never allow source tracking. Use the "--no-track-source" flag when you create a scratch or sandbox
|
|
885
|
-
org to disable source tracking.
|
|
886
|
-
|
|
887
|
-
EXAMPLES
|
|
888
|
-
Preview the retrieve of all changes from the org:
|
|
889
|
-
|
|
890
|
-
$ sf retrieve metadata preview
|
|
891
|
-
|
|
892
|
-
Preview the retrieve when ignoring any conflicts:
|
|
893
|
-
|
|
894
|
-
$ sf retrieve metadata preview --ignore-conflicts
|
|
895
|
-
|
|
896
|
-
FLAG DESCRIPTIONS
|
|
897
|
-
-c, --ignore-conflicts
|
|
898
|
-
|
|
899
|
-
Ignore conflicts and preview the retrieve of remote components, even if they will overwrite local changes.
|
|
900
|
-
|
|
901
|
-
This flag applies only to orgs that allow source tracking. It has no effect on orgs that don't allow it, such as
|
|
902
|
-
production orgs.
|
|
903
|
-
|
|
904
|
-
-o, --target-org=<value> Login username or alias for the target org.
|
|
905
|
-
|
|
906
|
-
Overrides your default org.
|
|
907
|
-
```
|
|
1535
|
+
_See code: [src/commands/project/retrieve/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/1.20.0/src/commands/project/retrieve/start.ts)_
|
|
908
1536
|
|
|
909
1537
|
<!-- commandsstop -->
|