Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.10 KB | None | 0 0
  1. <property environment="env"/>
  2. <property file="build.properties"/>
  3.  
  4. <!-- Setting default value for username, password and session id properties to empty string
  5. so unset values are treated as empty. Without this, ant expressions such as ${sf.username}
  6. will be treated literally.
  7. -->
  8. <condition property="sf.username" value=""> <not> <isset property="sf.username"/> </not> </condition>
  9. <condition property="sf.password" value=""> <not> <isset property="sf.password"/> </not> </condition>
  10. <condition property="sf.sessionId" value=""> <not> <isset property="sf.sessionId"/> </not> </condition>
  11.  
  12. <taskdef resource="com/salesforce/antlib.xml" uri="antlib:com.salesforce">
  13. <classpath>
  14. <pathelement location="ant-salesforce.jar" />
  15. </classpath>
  16. </taskdef>
  17.  
  18.  
  19. <!-- Deploy code on test environment -->
  20. <target name="deployToTest">
  21. <delete includeemptydirs="true">
  22. <fileset dir="${basedir}">
  23. <!-- <include name="src/profiles/"/> -->
  24. <include name="src/settings/Search.settings"/>
  25. <include name="src/workflows/Question.workflow"/>
  26. <include name="src/workflows/Reply.workflow"/>
  27. <include name="src/workflows/ExternalEventMapping.workflow"/>
  28. <include name="src/flows/Add_Contacts_to_Account_1-1.flow"/>
  29. <include name="src/flows/Auto_Allocate_Contacts_to_Account-1.flow"/>
  30. <include name="src/flows/Auto_Allocate_Contacts_to_Account-2.flow"/>
  31. </fileset>
  32. </delete>
  33. <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"/>
  34. </target>
  35.  
  36. <!-- Deploy code on UAT environment -->
  37. <target name="deployToUAT">
  38. <delete includeemptydirs="true">
  39. <fileset dir="src/workflows">
  40. <include name="**/Question.workflow"/>
  41. <include name="**/Reply.workflow"/>
  42. </fileset>
  43. <fileset dir="src/flows">
  44. <include name="**/Add_Contacts_to_Account_1-1.flow"/>
  45. </fileset>
  46. <!-- <fileset dir="src/settings"> -->
  47. <!-- <include name="**/Search.settings"/> -->
  48. <!-- </fileset> -->
  49. </delete>
  50. <sf:deploy username="${sf.usernameUAT}" password="${sf.passwordUAT}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlUAT}" maxPoll="${sf.maxPoll}" pollWaitMillis="${sf.pollWaitMillis}" deployRoot="src" rollbackOnError="true"/>
  51. </target>
  52.  
  53. <!-- Deploy code on production environment -->
  54. <target name="deployToProduction">
  55. <delete includeemptydirs="true">
  56. <fileset dir="src/workflows">
  57. <include name="**/Question.workflow"/>
  58. <include name="**/Reply.workflow"/>
  59. </fileset>
  60. <fileset dir="src/flows">
  61. <include name="**/Add_Contacts_to_Account_1-1.flow"/>
  62. </fileset>
  63. <fileset dir="src/settings">
  64. <include name="**/Search.settings"/>
  65. </fileset>
  66. </delete>
  67. <sf:deploy username="${sf.usernameProduction}" password="${sf.passwordProduction}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlProduction}" maxPoll="${sf.maxPoll}" pollWaitMillis="${sf.pollWaitMillis}" deployRoot="src" rollbackOnError="true"/>
  68. </target>
  69.  
  70. <!-- Retrive code from test -->
  71. <target name="retrieveCode">
  72. <!-- Retrieve the contents listed in the file codepkg/package.xml into the codepkg directory -->
  73. <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"/>
  74. </target>
  75.  
  76. <!-- Retrieve the information on all supported metadata type -->
  77. <target name="describeMetadata">
  78. <sf:describeMetadata username="${sf.usernameTest}" password="${sf.passwordTest}" sessionId="${sf.sessionId}" serverurl="${sf.serverurlTest}"/>
  79. </target>
  80.  
  81. # build.properties
  82. #
  83.  
  84. # Specify the login credentials for the desired Salesforce organization
  85.  
  86. #sandbox
  87. sf.usernameTest = MY_USER
  88. sf.passwordTest = MY_PASS+MY_TOKEN
  89. sf.serverurlTest = https://test.salesforce.com
  90.  
  91. #UAT
  92. sf.usernameUAT = #{USERNAME_UAT}
  93. sf.passwordUAT = #{PASSWORD_UAT}
  94. sf.serverurlUAT = #{SERVERURL_UAT}
  95.  
  96. #Production
  97. sf.usernameProduction = #{USERNAME_PRODUCTION}
  98. sf.passwordProduction = #{PASSWORD_PRODUCTION}
  99. sf.serverurlProduction = #{SERVERURL_PRODUCTION}
  100.  
  101. #sf.sessionId = <Insert your Salesforce session id here. Use this or username/password above. Cannot use both>
  102. #sf.pkgName = <Insert comma separated package names to be retrieved>
  103. #sf.zipFile = <Insert path of the zipfile to be retrieved>
  104. #sf.metadataType = <Insert metadata type name for which listMetadata or bulkRetrieve operations are to be performed>
  105.  
  106. # Use 'https://login.salesforce.com' for production or developer edition (the default if not specified).
  107. # Use 'https://test.salesforce.com for sandbox.
  108.  
  109. sf.maxPoll = 100000000
  110. sf.pollWaitMillis = 15000
  111. # If your network requires an HTTP proxy, see http://ant.apache.org/manual/proxy.html for configuration.
  112. #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement