Newer Version Available
Release Your App to Production
Now that all your tests have passed in the Full sandbox, you’re ready to deploy to
production.
You have two options to deploy your metadata to production using Salesforce CLI. For
information on all command options, view the command --help.
- Deploy your metadata directly to your production org using the source:deploy command.
- Convert your local DX project files to metadata format, then use the mdapi:deploy command.
- In your deployment run list, complete any pre-deployment tasks.
- Authorize your production org.
-
If you plan to use the mdapi:deploy command,
convert your files from source format to metadata format.
1sfdx force:source:convert -
Set up the quick deploy.
Salesforce CLI Command Command-Line Example 1sfdx force:source:deploy1sfdx force:source:deploy --checkonly \ 2--sourcepath force-app --targetusername production-org \ 3--testlevel RunLocalTests1sfdx force:mdapi:deploy1sfdx force:mdapi:deploy --checkonly \ 2--zipfile winter19.zip --targetusername production-org \ 3--testlevel RunLocalTestsThis command returns a job ID that you reference in the quick deploy.
- After the tests are run, verify that all the Apex tests have passed. Be sure that the tests cover at least 75% of the code being deployed.
-
Run the quick deploy:
Salesforce CLI Command Command-Line Example 1sfdx force:source:deploy1sfdx force:source:deploy \ 2--targetusername production-org \ 3--validateddeployrequestid jobID1sfdx force:mdapi:deploy1sfdx force:mdapi:deploy \ 2--targetusername production-org \ 3--validateddeployrequestid jobID - Open the production org, then perform any post-deployment tasks listed in the deployment run list.