root/trunk/deployment/build.xml

Revision 1134 (checked in by douglm, 6 years ago)

Fixes to timezone stuff

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