Currently we are following ChangeSet deployment model and want to switch to Org deployment model to support CI/CD process by taking advantage of Salesforce CLI commands.
But, for deployment to Orgs there are mainly two commands provided by salesforce.
sfdx force:source:deploy -- Deploys in source format to an org.
sfdx force:mdapi:deploy -- Deploys in metadata format to an org.
Among these, which command should be used during automated deployments ?
I got really confused after reading this post from Trailhead. Below is that section from Trailhead
Why Should I Use mdapi:deploy to Deploy My Changes from This Point Forward? The force:source:deploy command is meant for development use cases when you are interacting with a sandbox for development and local testing. The command is not transactional and attempts to deploy all components. If any change in your project has errors but other changes are valid, the command deploys all changes that are valid and compile. Those changes that can’t compile are not deployed, but the overall command completes successfully.
Instead use the Salesforce CLI force:mdapi:deploy command to perform integration testing and staging, and then deployment to production. If any component has errors, the command rolls back the entire deployment. This transactional process maintains the integrity of your staging and production environments.
Any suggestion on this will be really helpful.
force:source:deploy
(I personally prefer this format, much easier to merge conflicts), if your metadata in the repo in a classic format (like big Case.object file with fields, list views etc), useforce:mdapi:deploy
force:source:deploy
? Also, what is you comments on the Saleforce recommendation from Trailhead that I have mentioned above.