root/trunk/calendar3/deployment/build.xml

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

Mostly Dump/restore changes

Further schema changes - renamed calendar path column to bwpath

alter table CALENDARS alter column path rename to bwpath

Added ownerid column and index and publick to attendees

alter table ATTENDEES add column ownerid int
alter table ATTENDEES add column publick char(1)
CREATE INDEX vattendees_user ON attendees (ownerid)

Changed CalOptions? to support extra classes and fix bugs.

Moved system parameters into xml options.
Moved dump/restore runtime options into xml options.

Removed use of bedework.dumprestore.options file. Multiple files just lead to
confusion and the zipped version will eventually allow overrides as run time
parameters.

Many changes to deployment build files to build dump/restore applications as
zipped runnable packages

Disabled (for the time being at least) the targets which run the dump/restore
applications. For the moment cd into the temp directory and run it, e.g.

cd quickstart/calendar3/temp/shellscr/dumpres/
chmod +x cmd
./cmd restore ~/.bedework/caldata.xml

or unzip the zipped application that is in the dist directory.

The zipped application will handle dump, restore, initdb and has a backup option
to save the data in a file with a date tagged name.

Dump new attendee fields.

Still to do:
Check attendees restored correctly

Ensure all fields are dumped and restored
Use subscription name in view dump instead of id.

Use the event key fields instead of id for annotation target and master.

Not dumping preferred calendars in version3.0 - do so.

Need to set calType in 2.3 restore

EventAnnotations? still need work. target and master need setiing.

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