prodly:deploy
To deploy data from one Salesforce environment directly to another Salesforce environment, enter this command at the command line prompt in your Salesforce CLI command shell:
$ sf prodly:deploy DATA [ENVIRONMENTS] [OPTIONS]
Usage:
$ sf prodly:deploy -v <value> -o <value> [--json] [-t <value>] [-e] [-d <value>] [-q <value>] [-b <value>] [-n <value>] [-z <value>] [-p <value>] [-l] [-s <value>]
The parameters provide for maximum flexibility when using the CLI command. Deployment requires these three pieces of information:
- Deployment instructions (deployment plan or data set)
- The environment to use as the source of the data to deploy
- The environment to use as the source destination of the data to deploy
Here are all the available parameters:
Data
Parameter | Purpose |
---|---|
-t, --dataset=<value> | Use to specify the name or record ID of the data set to deploy. |
-p, --plan=<value> | Use to specify the name or record ID of the deployment plan to deploy. |
Notes: Specify exactly one deployment instructions parameter. Specifying zero or more than one deployment instructions parameter results in an error. For each data set and deployment plan in the deployment, Active must be selected in the corresponding record.
Environments
Parameter | Purpose |
---|---|
None | Use to specify the dev hub org as the source environment and the scratch org as the destination environment. |
-s, --source=<value> | Use to specify the source managed instance ID as the source environment. |
-d, --destination=<value> | Use to specify the destination managed instance ID as the destination environment. |
Notes: Specify zero, one, or both org parameters. When not specifying an org parameter, you must specify the scratch and dev hub orgs either with the optional setup steps or with the $ sf config set target-dev-hub=”<devhubusername_or_alias>” -g
and $ sf config set target-org=”<username_or_alias>” -g
options. When specifying a connection record, Active must be selected in the Prodly connection record. When specifying a connection record as the destination environment, Do Not Allow As Destination must not be selected in the Prodly connection record. When specifying a connection record by a name that exists for more than one record, Prodly uses the last-modified connection. The dev hub org cannot be the destination environment.
Options
Parameter | Purpose |
---|---|
-b, --label=<value> | Use to specify a nickname for the environment. |
-e, --deactivate | Use to temporarily deactivate all events Prodly has permission to deactivate. |
-l, --simulation | Use to preview the source records that would be deployed. |
-n, --name=<value> | Use to specify a name for the deployment. |
-z, --notes=<value> | Use to include notes in the deployment results. |
-q, --filter=<value> | Use to specify a query filter override for a data set deployment. |
-o, --target-org=<value> | Use to specify the username or alias of the destination environment, overriding any default scratch org you specified in the optional setup steps. Not required if the default value is already set. |
-v, --target-dev-hub=<value> | Use to specify the username or alias of the dev hub org, overriding any dev hub org you specified in the optional setup steps. Not required if the default value is already set. |
–-json | Use to receive an output response. When included, the response is in JSON format. When not included, no response is given. |
-–apiversion=<value> | Use to override the API version used for API requests made by this command. |
-–loglevel=<value> | Use to specify the logging level for this command invocation with one of these levels:errorwarninfodebugtracefatalFor details, refer to https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_log_messages.htm. |
Response
When you include -–json
in your prodly:deploy
command, you receive the following output when the deployment initiates:
{
“Deployment launched with Job ID: “<JobID>”
}
Examples
Command | Result |
---|---|
$ sf prodly:deploy -n scratchorg --target-org FixesScratchOrg -v MainDevHub | Deploying from the dev hub, the control org, to the scratch org, auto managed with the provided name. |
$ sf prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com | Deploying from the dev hub, the control org, to the scratch org. Long param names. |
$ sf prodly:deploy --target-org test-utxac7gbati9@example.com -v jsmith@acme.com -d "UAT Sandbox Connection" | Deploying from the scratch org to the UAT sandbox, using the named connection record in the dev hub, control org. |
$ sf prodly:deploy --target-org test-utxac7gbati9@example.com --target-dev-hub jsmith@acme.com --source "UAT Sandbox Connection" | Deploying to the scratch org from the UAT sandbox, using the named connection record in the dev hub, control org. Long param names. |
The Prodly service retrieves the active control environment connection information from the dev hub control org. If not found, the service returns an error and terminates.
The scratch and dev hub org connections are based on access tokens only. You cannot use refresh tokens. This requirement means the session settings you configure in the environments apply. Any deployment running for longer than the session timeout terminates on the next connection access.
For any deployment involving the dev hub org, the plugin uses the control environment connection from Prodly as the control environment connection for the actual deployment, not the dev hub org connection from CLI. The user who created the control environment connection in Prodly can be different than the user who authenticated the dev hub org in Salesforce CLI.
The plugin uses the CLI dev hub connection to query for connections and insert the result and uses the CLI dev hub connection as the source connection when the source environment is also the control environment. The Prodly service uses the control environment connection to report results and the source connection to query for data and metadata.
Prodly service inserts deployment result record into your control environment. Monitor the deployment and view the results in the Prodly app on the Deployment Results tab.