root/trunk/deployment/build.xml

Revision 1765 (checked in by douglm, 5 years ago)

Fix jboss build so that virtual hosts and context roots are set from the properties.

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