I need one help to deploy different components like classes, triggers, objects, profiles, permission sets, etc from sandbox to the production org.
I used following command to deploy all the items on the production. But I noticed that it only validates the changes and is not giving any option to deploy the components
sfdx force:source:deploy -m ApexClass:TestUtility -l RunLocalTests -c -w 3 -u myProdUserName
I read different blogs and found that we can use the command "sfdx force:mdapi:deploy
" for the deployment. But, I didn't get the exact syntax/procedure or any option in the VS Code which allow deploying all the components on the production.
Best Answer
You should read through the documentation on force:source:deploy again
The reason why you're only validating the changes is because that's exactly what you're telling sfdx to do when you use the
-c
flagFurther, when using the
-m
flag, you're either deploying everything in your project of a particular metadata type (when you use, for example-m ApexClass
), or only deploying specific components (when you use-m ApexClass:MyClass
, onlyMyClass
is deployed)Put into words, that command you're currently running says...
Using the
-p
flag to specify a path to deploy to is probably the easiest way to do what you're describing. Using it and pointing to the "force-app" folder would deploy everything in your project unless you've done some serious modification to your project structure.