root/trunk/deployment/build.xml

Revision 1164 (checked in by douglm, 7 years ago)

Add dojo to deployment process

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================== Deployment build file =======================
4      This directory and the files within it are to be part of the config
5      and deployment process.
6
7      A number of properties of the form org.bedework.install.XXX will be
8      defined, each indicating that a particualr component is to be deployed.
9
10      Targets below will be executed only if that property is defined.
11
12      Adding a new configuration, e.g. a different portal platform, requires
13      the steps:
14         Create a subdirectory in each components subdirectory,
15         e.g.  webadmin/myportal
16
17         Create any other required resource directories and resources and
18         create a build.xml file to configure and package the component(s).
19
20         Update the config program to load, save and display the new
21         properties for that configuration.
22
23         Add an antcall for each component and a corresponding target
24
25      Authors: Mike Douglass   douglm@rpi.edu
26      =================================================================== -->
27
28 <project name="deploy.bedework" default="init">
29   <property name="base.name" value="deployment"/>
30     <!-- Load the location of the libraries -->
31     <property file="${org.bedework.project.bedework}/build/libjars.properties" />
32
33   <target name="init" >
34     <dirname property="this.build.dir" file="${ant.file}"/>
35
36     <property name="source.home" location="${this.build.dir}/src"/>
37
38     <!-- Load default deploy properties -->
39     <property file="${this.build.dir}/deploy.properties"/>
40
41     <!-- ==================== config properties ========================= -->
42     <property name="org.bedework.clone.name" value="${org.bedework.clone.default}" />
43     <property name="org.bedework.config.properties"
44               location="${org.bedework.config.base}/configs/${org.bedework.clone.name}.properties" />
45     <property name="org.bedework.config.options"
46               location="${org.bedework.config.base}/configs/${org.bedework.clone.name}.options.xml" />
47
48     <echo message="==========================================================" />
49     <echo message="Use config properties ${org.bedework.config.properties}" />
50     <loadproperties
51           srcFile="${org.bedework.config.properties}" >
52       <filterchain>
53         <expandproperties/>
54       </filterchain>
55     </loadproperties>
56
57     <!-- default to debug off -->
58     <property name="app.debug.val" value="0" />
59
60     <!-- set this for the war builds -->
61     <dirname property="app.root.dir" file="${ant.file}"/>
62
63     <!-- Common resources directory -->
64     <property name="org.bedework.common.resources"
65               location="${app.root.dir}/resources" />
66
67
68     <!-- ==================== config properties =========================
69     <property name="org.bedework.config.properties"
70               location="${org.bedework.config.base}/configs/${org.bedework.clone.name}.properties" />
71
72     <echo message="==========================================================" />
73     <echo message="Use clone properties ${org.bedework.config.properties}" />
74     <loadproperties
75           srcFile="${org.bedework.config.properties}" >
76       <filterchain>
77         <expandproperties/>
78       </filterchain>
79     </loadproperties>
80     -->
81   </target>
82
83   <target name="deftasks" depends="init">
84     <path id="app.xml.cp">
85       <pathelement location="${org.bedework.deployutil.jar}"/>
86     </path>
87
88     <taskdef name="forEachApp"
89              classname="org.bedework.deployment.ForEachAppTask">
90       <classpath refid="app.xml.cp"/>
91     </taskdef>
92
93     <taskdef name="resolveFile"
94              classname="org.bedework.deployment.ResolveFile">
95       <classpath refid="app.xml.cp"/>
96     </taskdef>
97   </target>
98
99   <target name="build.configured" depends="deftasks" >
100     <!-- Clean up before we start -->
101     <delete dir="${org.bedework.temp.wars.home}" />
102
103     <antcall target="build.standalone.apps" inheritrefs="true" />
104
105     <antcall target="build.portal.apps" inheritrefs="true" />
106
107     <antcall target="build.j2ee.apps" inheritrefs="true" />
108   </target>
109
110   <!-- =================================================================
111        Targets called by the build.configured target. Each is conditional on a
112        config property and each executes a build file in a subdirectory of
113        this component.
114        ================================================================= -->
115
116   <target name="build.standalone.apps" if="org.bedework.global.build.standalone.app" >
117     <!-- ======================= webconfig - only standalone =================
118     <ant antfile="${org.bedework.deployment.base}/webconfig/webapp/build.xml"
119          inheritrefs="true" target="build.configured" />
120           -->
121
122     <property name="org.bedework.deploy.kind" value="webapp" />
123     <antcall target="build.configured.apps" inheritrefs="true" />
124   </target>
125
126   <target name="build.portal.apps" if="org.bedework.global.portal.platform" >
127     <property name="org.bedework.deploy.kind"
128               value="${org.bedework.global.portal.platform}" />
129     <antcall target="build.configured.apps" inheritrefs="true" />
130   </target>
131
132   <target name="build.j2ee.apps" if="org.bedework.global.j2ee.platform" >
133     <property name="org.bedework.deploy.kind"
134               value="${org.bedework.global.j2ee.platform}" />
135     <antcall target="build.configured.apps" inheritrefs="true" />
136   </target>
137
138   <!-- =================================================================
139                          The deploy target.
140        ================================================================= -->
141
142   <target name="deploy" depends="deftasks" >
143     <!-- Clean up before we start -->
144     <delete dir="${org.bedework.temp.wars.home}" />
145
146     <!--<antcall target="deploy.standalone.apps" inheritrefs="true" />-->
147     <if>
148       <isset property="org.bedework.global.build.standalone.app" />
149       <then>
150         <antcall target="deploy.apps" inheritrefs="true" >
151           <param name="org.bedework.deploy.kind" value="webapp" />
152         </antcall>
153       </then>
154     </if>
155
156     <!--<antcall target="deploy.shellscr.apps" inheritrefs="true" />-->
157     <!-- Always build the shellscr stuff.-->
158     <antcall target="deploy.apps" inheritrefs="true" >
159       <param name="org.bedework.deploy.kind" value="shellscr" />
160     </antcall>
161
162     <!-- <antcall target="deploy.portal.apps" inheritrefs="true" />-->
163     <if>
164       <isset property="org.bedework.global.portal.platform" />
165       <then>
166         <antcall target="deploy.apps" inheritrefs="true" >
167           <param name="org.bedework.deploy.kind"
168                  value="${org.bedework.global.portal.platform}" />
169         </antcall>
170       </then>
171     </if>
172
173     <!-- <antcall target="deploy.j2ee.apps" inheritrefs="true" />-->
174     <if>
175       <isset property="org.bedework.global.j2ee.platform" />
176       <then>
177         <antcall target="deploy.apps" inheritrefs="true" >
178           <param name="org.bedework.deploy.kind"
179                  value="${org.bedework.global.j2ee.platform}" />
180         </antcall>
181       </then>
182     </if>
183
184     <!-- copy startup website that sends you to the applications -->
185     <delete dir="${webapp.root.dir}/bedework"/>
186     <mkdir dir="${webapp.root.dir}/bedework"/>
187     <copy todir="${webapp.root.dir}/bedework">
188       <fileset dir="${app.root.dir}/resources/bedework"/>
189     </copy>
190
191     <!-- copy libs that the application server needs -->
192     <antcall target="deploy.appserver.jdbcdriver" inheritrefs="true" />
193     <antcall target="deploy.appserver.javatools" inheritrefs="true" />
194   </target>
195
196   <!-- =================================================================
197        Targets called by the deploy target. Each is conditional on a
198        config property and each executes a build file in a subdirectory of
199        this component.
200        ================================================================= -->
201
202   <!--
203   <target name="deploy.standalone.apps" if="org.bedework.global.build.standalone.app" >
204     <property name="org.bedework.deploy.kind" value="webapp" />
205     <antcall target="deploy.apps" inheritrefs="true" />
206   </target>
207
208   <target name="deploy.portal.apps" if="org.bedework.global.portal.platform" >
209     <property name="org.bedework.deploy.kind"
210               value="${org.bedework.global.portal.platform}" />
211     <antcall target="deploy.apps" inheritrefs="true" />
212   </target>
213
214   <target name="deploy.j2ee.apps" if="org.bedework.global.j2ee.platform" >
215     <property name="org.bedework.deploy.kind"
216               value="${org.bedework.global.j2ee.platform}" />
217     <antcall target="deploy.apps" inheritrefs="true" />
218   </target>
219   -->
220
221   <!-- Always build the shellscr stuff.
222   <target name="deploy.shellscr.apps" >
223     <property name="org.bedework.deploy.kind" value="shellscr" />
224     <antcall target="deploy.apps" inheritrefs="true" />
225   </target>
226   -->
227
228   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
229        necessary -->
230   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
231     <copy file="${org.bedework.default.lib}/xalan.jar"
232           todir="${appserver.endorsed.dir}"/>
233   </target>
234
235   <target name="deploy.appserver.jdbcdriver"
236           if="appserver.jdbcdriver.jar" >
237     <!-- copy jdbc jar so datasources work -->
238     <copy todir="${appserver.lib.dir}" file="${appserver.jdbcdriver.jar}"/>
239   </target>
240
241   <target name="deploy.appserver.javatools"
242           if="java.tools.jar" >
243     <!-- copy tools jar so jsps work -->
244     <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
245   </target>
246
247   <!-- =================================================================
248        Targets called by the build.configured target. Each is conditional on a
249        config property and each executes a build file in a subdirectory of
250        this component.
251        ================================================================= -->
252   <target name="build.configured.apps">
253     <forEachApp names="${org.bedework.install.app.names}"
254                 prefix="org.bedework.deploy"
255                 appPrefix="org.bedework.app"
256                 projectPrefix="org.bedework.project">
257       <sequential>
258         <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
259                    property="app.kind.available" />
260         <antcall target="build.available.configured.app" inheritrefs="true" />
261       </sequential>
262     </forEachApp>
263
264     <!-- ======================= termination tasks ================= -->
265     <!--
266     <property name="org.bedework.deploy.type.dir"
267               location="${org.bedework.deployment.base}/termination" />
268               -->
269
270     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
271          inheritrefs="true" target="build.configured" />
272   </target>
273
274   <target name="build.available.configured.app" if="app.kind.available">
275     <!-- Pick out the application build properties based on the prefix "org.bedework.app."
276          and the deployment name -->
277     <propertyset id="build-app-properties">
278       <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
279       <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
280     </propertyset>
281   </target>
282
283   <target name="deploy.apps">
284     <forEachApp names="${org.bedework.install.app.names}"
285                 prefix="org.bedework.deploy"
286                 appPrefix="org.bedework.app"
287                 projectPrefix="org.bedework.project">
288       <sequential>
289         <antcall target="deploy.available.app" inheritrefs="true" />
290       </sequential>
291     </forEachApp>
292
293     <!-- ======================= termination tasks ================= -->
294     <!--
295     <property name="org.bedework.deploy.type.dir"
296               location="${org.bedework.deployment.base}/termination" />
297               -->
298
299     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
300          inheritrefs="true" target="deploy" />
301   </target>
302
303   <target name="deploy.available.app">
304     <if>
305       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
306       <then>
307         <propertyset id="deploy-app-properties">
308           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
309           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
310         </propertyset>
311
312         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
313              inheritrefs="true" target="deploy" >
314           <propertyset refid="deploy-app-properties" />
315         </ant>
316       </then>
317     </if>
318   </target>
319   <!--
320   <target name="wrap.deploy.available.app">
321     <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
322                property="app.kind.available" />
323
324     <antcall target="deploy.available.app" inheritrefs="true" />
325   </target>
326
327   <target name="deploy.available.app" if="app.kind.available">
328     <propertyset id="deploy-app-properties">
329       <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
330       <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
331     </propertyset>
332
333     <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
334          inheritrefs="true" target="deploy" >
335       <propertyset refid="deploy-app-properties" />
336     </ant>
337   </target>
338   -->
339 </project>
340
Note: See TracBrowser for help on using the browser.