Understanding deploy

The deploy call completes successfully only if all of the following must be true.

You cannot run more than one deployMetadata API call at the same time.

The Force.com Migration Tool provides the task deploy which can be incorporated into your deployment scripts. You can modify the build.xml sample to include your organization's classes and triggers. The properties of the deploy task are as follows:

username
The username for logging into the Salesforce production organization.
password
The password associated for logging into the Salesforce production organization.
serverURL
The URL for the Salesforce server you are logging into. If you do not specify a value, the default iswww.salesforce.com.
deployRoot
The local directory that contains the Apex classes and triggers, as well as any other metadata, that you want to deploy. The best way to create the necessary file structure is to retrieve it from your organization or sandbox. See Understanding retrieveCode for more information.
  • Apex class files must be in a subdirectory named classes. You must have two files for each class, named as follows:
    • classname.cls
    • classname.cls-meta.xml
    For example, MyClass.cls and MyClass.cls-meta.xml. The -meta.xml file contains the API version and the status (active/inactive) of the class.
  • Apex trigger files must be in a subdirectory named triggers. You must have two files for each trigger, named as follows:
    • triggername.trigger
    • triggername.trigger-meta.xml
    For example, MyTrigger.trigger and MyTrigger.trigger-meta.xml. The -meta.xml file contains the API version and the status (active/inactive) of the trigger.
  • The root directory contains an XML file package.xml that lists all the classes, triggers, and other objects to be deployed.
  • The root directory optionally contains an XML file destructiveChanges.xml that lists all the classes, triggers, and other objects to be deleted from your organization.
checkOnly
Specifies whether the classes and triggers are deployed to the target environment or not. This property takes a Boolean value: true if you do not want to save the classes and triggers to the organization, false otherwise. If you do not specify a value, the default is false.
runTests
The name of the class that contains the unit tests that you want to run.
Note
This parameter is ignored when deploying to a Salesforce production organization. Every unit test in your organization namespace is executed.
runAllTests
This property takes a Boolean value: true if you want run all tests in your organization, false if you do not. You should not specify a value for runTests if you specify true for runAllTests.
Note
This parameter is ignored when deploying to a Salesforce production organization. Every unit test in your organization namespace is executed.
© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.