Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <property environment="env"/>
- <property file="build.properties"/>
- <!-- Setting default value for username, password and session id properties to empty string
- so unset values are treated as empty. Without this, ant expressions such as ${sf.username}
- will be treated literally.
- -->
- <condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not> </condition>
- <condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not> </condition>
- <condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not> </condition>
- <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
- <classpath>
- <pathelement location="ant-salesforce.jar" />
- </classpath>
- </taskdef>
- <!-- Deploy code on test environment -->
- <target name="deployToTest">
- <delete includeemptydirs="true">
- <fileset dir="${basedir}">
- <!-- <include name="src/profiles/"/> -->
- <include name="src/settings/Search.settings"/>
- <include name="src/workflows/Question.workflow"/>
- <include name="src/workflows/Reply.workflow"/>
- <include name="src/workflows/ExternalEventMapping.workflow"/>
- <include name="src/flows/Add_Contacts_to_Account_1-1.flow"/>
- <include name="src/flows/Auto_Allocate_Contacts_to_Account-1.flow"/>
- <include name="src/flows/Auto_Allocate_Contacts_to_Account-2.flow"/>
- </fileset>
- </delete>
- <sf:deploy username="${sf.usernameTest}" password="${sf.passwordTest}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlTest}" maxPoll="${sf.maxPoll}" pollWaitMillis="${sf.pollWaitMillis}" deployRoot="src" rollbackOnError="true" autoUpdatePackage="true" ignoreWarnings="true"/>
- </target>
- <!-- Deploy code on UAT environment -->
- <target name="deployToUAT">
- <delete includeemptydirs="true">
- <fileset dir="src/workflows">
- <include name="**/Question.workflow"/>
- <include name="**/Reply.workflow"/>
- </fileset>
- <fileset dir="src/flows">
- <include name="**/Add_Contacts_to_Account_1-1.flow"/>
- </fileset>
- <!-- <fileset dir="src/settings"> -->
- <!-- <include name="**/Search.settings"/> -->
- <!-- </fileset> -->
- </delete>
- <sf:deploy username="${sf.usernameUAT}" password="${sf.passwordUAT}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlUAT}" maxPoll="${sf.maxPoll}" pollWaitMillis="${sf.pollWaitMillis}" deployRoot="src" rollbackOnError="true"/>
- </target>
- <!-- Deploy code on production environment -->
- <target name="deployToProduction">
- <delete includeemptydirs="true">
- <fileset dir="src/workflows">
- <include name="**/Question.workflow"/>
- <include name="**/Reply.workflow"/>
- </fileset>
- <fileset dir="src/flows">
- <include name="**/Add_Contacts_to_Account_1-1.flow"/>
- </fileset>
- <fileset dir="src/settings">
- <include name="**/Search.settings"/>
- </fileset>
- </delete>
- <sf:deploy username="${sf.usernameProduction}" password="${sf.passwordProduction}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlProduction}" maxPoll="${sf.maxPoll}" pollWaitMillis="${sf.pollWaitMillis}" deployRoot="src" rollbackOnError="true"/>
- </target>
- <!-- Retrive code from test -->
- <target name="retrieveCode">
- <!-- Retrieve the contents listed in the file codepkg/package.xml into the codepkg directory -->
- <sf:retrieve username="${sf.usernameTest}" password="${sf.passwordTest}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlTest}" maxPoll="${sf.maxPoll}" pollWaitMillis="${sf.pollWaitMillis}" retrieveTarget="src" unpackaged="src/package.xml"/>
- </target>
- <!-- Retrieve the information on all supported metadata type -->
- <target name="describeMetadata">
- <sf:describeMetadata username="${sf.usernameTest}" password="${sf.passwordTest}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlTest}"/>
- </target>
- # build.properties
- #
- # Specify the login credentials for the desired Salesforce organization
- #sandbox
- sf.usernameTest = MY_USER
- sf.passwordTest = MY_PASS+MY_TOKEN
- sf.serverurlTest = https://test.salesforce.com
- #UAT
- sf.usernameUAT = #{USERNAME_UAT}
- sf.passwordUAT = #{PASSWORD_UAT}
- sf.serverurlUAT = #{SERVERURL_UAT}
- #Production
- sf.usernameProduction = #{USERNAME_PRODUCTION}
- sf.passwordProduction = #{PASSWORD_PRODUCTION}
- sf.serverurlProduction = #{SERVERURL_PRODUCTION}
- #sf.sessionId = <Insert your Salesforce session id here. Use this or username/password above. Cannot use both>
- #sf.pkgName = <Insert comma separated package names to be retrieved>
- #sf.zipFile = <Insert path of the zipfile to be retrieved>
- #sf.metadataType = <Insert metadata type name for which listMetadata or bulkRetrieve operations are to be performed>
- # Use 'https://login.salesforce.com' for production or developer edition (the default if not specified).
- # Use 'https://test.salesforce.com for sandbox.
- sf.maxPoll = 100000000
- sf.pollWaitMillis = 15000
- # If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement