Salesforce Deployments with ANT Migration Tool and Batch Scripts

Apache’s Ant is a Java library and command-line tool which allows quick deployment/migration of components into a target system. Once you installed migration tool, it can retrieve and deploy into target org by entering several commands. Instructions to install ANT can be found here or here. If you have installed ANT correctly, entering ant –version in the command line will display ANT version as below. If you having trouble with installation, please comment below.

Apache Ant(TM) version 1.10.0 compiled on December 27 2016

Assuming ANT is stored in c:\ANT directory, Following windows batch script allows fast & easy deployments with single line of command. Copy script into a file named deploy.bat, and execute it to do the deployment.

@RD /S /Q "C:\ANT\retrieveUnpackaged"
cd /d C:\ANT
call ant retrieveUnpackaged
call ant deployUnpackaged

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.