Build script for Salesforce projects
-
Ant version greater than 1.6, tested with 1.10.1 (latest version).
-
Install Java, ant, and the Force.com Migration Tool (ant-salesforce.jar)
-
Copy
./build-sample.properties
to../../build.properties
(two directories up) -
Update
../../build.properties
with your own usernames and passwords
See the build.xml for the definitive list of commands. Typical syntax is:
ant dev2qa -Dversion=1.0
This will command will:
- retrieve the Salesforce metadata from the dev environment based upon
package-1.0.xml
- store this metadata in a local folder called
dev sprint 1.0
- copy
destructiveChanges-1.0.xml
(if it exists) todev sprint 1.0/destructiveChanges.xml
- deploy this metadata to the qa environment
Our environment flow looks like:
Often used commands are:
ant local2dev -Dversion=1.0 -Dsource=dev
ant local2itdev -Dversion=1.0 -Dsource=dev
ant dev2full -Dversion=1.0
ant qa2full -Dversion=1.0
ant itdev2full -Dversion=1.0
ant itdev2full-specified-tests -Dversion=1.0 -DspecifiedTests=TestClassName
ant full2prod -Dversion=1.0
ant full2prod-specified-tests -Dversion=1.0 -DspecifiedTests=TestClassName
Optional parameters exist for checkOnly and/or runAllTests (which default to false). For example:
ant dev2qa -Dversion=3.6 -DcheckOnly=true -DrunAllTests=true