-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
217 lines (187 loc) · 9.51 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<project basedir="." default="test" name="nCino SFDC deploy targets" xmlns:sf="antlib:com.salesforce">
<property file="build.properties"/>
<property environment="env"/>
<path id="ant.additions.classpath">
<fileset dir="test/lib"/>
</path>
<!-- Main nCino deploy target for installed packages -->
<target name="deployDependencies">
<sf:deploy autoUpdatePackage="true" deployRoot="${sf.dependencyRepository}" ignoreWarnings="true" logType="Detail" maxPoll="999" password="${sf.password}${sf.token}" rollbackOnError="true" serverurl="${sf.serverurl}" singlepackage="true" testLevel="NoTestRun" trace="false" username="${sf.username}"/>
</target>
<!-- Main nCino deploy target -->
<target name="deployNcino">
<sf:deploy autoUpdatePackage="true" deployRoot="${sf.repository}" ignoreWarnings="true" logType="Detail" maxPoll="9999" password="${sf.password}${sf.token}" rollbackOnError="true" serverurl="${sf.serverurl}" singlepackage="true" testLevel="NoTestRun" trace="false" username="${sf.username}"/>
</target>
<!-- Main nCino deploy target (for CI builds) -->
<target name="deployNcinoCI">
<sf:deploy autoUpdatePackage="true" checkOnly="true" deployRoot="${sf.repository}" ignoreWarnings="true" logType="Detail" maxPoll="9999" password="${sf.password}${sf.token}" rollbackOnError="true" serverurl="${sf.serverurl}" singlepackage="true" testLevel="${sf.testLevel}" trace="false" username="${sf.username}"/>
</target>
<!-- Cancel nCino deploy target -->
<target name="cancelDeploy">
<sf:cancelDeploy username="${sf.username}" password="${sf.password}${sf.token}" requestId="${sf.requestId}" serverurl="${sf.serverurl}" trace="false" maxPoll="999" />
</target>
<target name="deployNcinoCore">
<sf:deploy autoUpdatePackage="true" deployRoot="${sf.pkgName}" ignoreWarnings="true" logType="Detail" maxPoll="999" password="${sf.password}${sf.token}" rollbackOnError="true" serverurl="${sf.serverurl}" testLevel="RunLocalTests" trace="false" username="${sf.username}"/>
</target>
<!-- Test out deploy and retrieve verbs for package 'mypkg' -->
<target name="test">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<!-- Upload the contents of the "mypkg" package -->
<sf:deploy deployRoot="mypkg" password="${sf.password}${sf.token}" serverurl="${sf.serverurl}" username="${sf.username}"/>
<mkdir dir="retrieveOutput"/>
<!-- Retrieve the contents into another directory -->
<sf:retrieve packageNames="MyPkg" password="${sf.password}${sf.token}" retrieveTarget="retrieveOutput" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
<!-- Retrieve an unpackaged set of metadata from your org -->
<!-- The file unpackaged/package.xml lists what is to be retrieved -->
<target name="retrieveUnpackaged">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<mkdir dir="retrieveUnpackaged"/>
<!-- Retrieve the contents into another directory -->
<sf:retrieve password="${sf.password}${sf.token}" retrieveTarget="retrieveUnpackaged" serverurl="${sf.serverurl}" unpackaged="unpackaged/package.xml" username="${sf.username}"/>
</target>
<!-- Retrieve all the items of a particular metadata type -->
<target name="bulkRetrieve">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:bulkRetrieve metadataType="${sf.metadataType}" password="${sf.password}${sf.token}" retrieveTarget="retrieveUnpackaged" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
<!-- Retrieve metadata for all the packages specified under packageNames -->
<target name="retrievePkg">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:retrieve packageNames="${sf.pkgName}" password="${sf.password}${sf.token}" retrieveTarget="retrieveOutput" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
<!-- Deploy the unpackaged set of metadata retrieved with retrieveUnpackaged -->
<target name="deployUnpackaged">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:deploy autoUpdatePackage="true" deployRoot="retrieveUnpackaged" ignoreWarnings="true" logType="Detail" password="${sf.password}${sf.token}" rollbackOnError="false" serverurl="${sf.serverurl}" trace="false" username="${sf.username}"/>
</target>
<target name="copyGit">
<copy todir="/mnt/bamboo-ebs/bamboo-agent/build-dir/LLCBI-LLCBIMASTER-SYNC/loan_life_cycle_base">
<fileset dir="/mnt/bamboo-ebs/tmp/loan_life_cycle_base"/>
</copy>
</target>
<target name="deployAndTestAndReport">
<taskdef classname="com.claimvantage.force.ant.DeployWithXmlReportTask" classpathref="ant.additions.classpath" name="sfdeploy"/>
<delete dir="test-report-xml" quiet="true"/>
<sfdeploy deployRoot="${sf.repository}" junitreportdir="test-report-xml" password="${sf.password}${sf.token}" runalltests="false" serverurl="${sf.serverurl}" username="${sf.username}">
<!-- Run only tests with file names that match this pattern -->
<batchtest>
<fileset dir="${sf.repository}/classes">
<include name="*Test*.cls"/>
</fileset>
</batchtest>
</sfdeploy>
</target>
<target name="installGit">
<exec executable="/mnt/bamboo-ebs/bin/customise-extras.sh"/>
</target>
<target name="installTestJsDependency">
<exec dir="${sf.repository}" executable="npm">
<arg value="install"/>
</exec>
</target>
<target name="runJsTest">
<exec dir="${sf.repository}" executable="make">
<arg value="test"/>
</exec>
</target>
<target name="syncDeployNcino">
<delete dir="${sf.repository}"/>
<antcall target="syncGitHub"/>
<!-- <antcall target="installTestJsDependency"></antcall><antcall target="runJsTest"></antcall>-->
<antcall target="deployNcino"/>
</target>
<target name="syncGitHub">
<delete dir="${sf.repository}"/>
<exec executable="git">
<arg value="clone"/>
<arg value="-b"/>
<arg value="${sf.branch}"/>
<arg value="[email protected]:loanlifecycle/${sf.repository}.git"/>
</exec>
</target>
<target name="syncGitHubSvn">
<delete dir="${sf.repository}"/>
<exec executable="svn">
<arg value="checkout"/>
<arg value="https://github.com/loanlifecycle/${sf.repository}"/>
</exec>
</target>
<target name="deployPkg">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:deploy autoUpdatePackage="true" deployRoot="retrieveOutput" ignoreWarnings="true" logType="Detail" password="${sf.password}${sf.token}" rollbackOnError="false" serverurl="${sf.serverurl}" singlePackage="true" trace="false" username="${sf.username}"/>
</target>
<!-- Deploy a zip of metadata files to the org -->
<target name="deployZip">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:deploy ignoreWarnings="true" maxPoll="100" password="${sf.password}${sf.token}" pollWaitMillis="1000" rollbackOnError="false" serverurl="${sf.serverurl}" username="${sf.username}" zipFile="${sf.zipFile}"/>
</target>
<!-- Shows deploying code & running tests for code in directory -->
<target name="deployCode">
<!-- Upload the contents of the "codepkg" directory, running the tests for just 1 class -->
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:deploy deployRoot="codepkg" password="${sf.password}${sf.token}" serverurl="${sf.serverurl}" username="${sf.username}">
<runTest>SampleDeployClass</runTest>
</sf:deploy>
</target>
<!-- Shows removing code; only succeeds if done after deployCode -->
<target name="undeployCode">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:deploy deployRoot="removecodepkg" password="${sf.password}${sf.token}" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
<!-- Shows retrieving code; only succeeds if done after deployCode -->
<target name="retrieveCode">
<!-- Retrieve the contents listed in the file codepkg/package.xml into the codepkg directory -->
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:retrieve password="${sf.password}${sf.token}" retrieveTarget="codepkg" serverurl="${sf.serverurl}" unpackaged="codepkg/package.xml" username="${sf.username}"/>
</target>
<!-- Shows deploying code, running all tests, and running tests (1 of which fails), and logging. -->
<target name="deployCodeFailingTest">
<!-- Upload the contents of the "codepkg" package, running all tests -->
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:deploy deployRoot="codepkg" logType="Debugonly" password="${sf.password}${sf.token}" runAllTests="true" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
<!-- Shows check only; never actually saves to the server -->
<target name="deployCodeCheckOnly">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:deploy checkOnly="true" deployRoot="codepkg" password="${sf.password}${sf.token}" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
<!-- Retrieve the information of all items of a particular metadata type -->
<target name="listMetadata">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:listMetadata metadataType="${sf.metadataType}" password="${sf.password}${sf.token}" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
<!-- Retrieve the information on all supported metadata type -->
<target name="describeMetadata">
<classpath>
<pathelement location="lib/ant-salesforce.jar"/>
</classpath>
<sf:describeMetadata password="${sf.password}${sf.token}" serverurl="${sf.serverurl}" username="${sf.username}"/>
</target>
</project>