root/trunk/deployment/build.xml

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

Add the basic framework for a new event submission web application.

This does not work yet though the system as a whole builds successfully.

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