Weitere Modifikation des BUILD Systems:

* das verwendete Bundle-Verzeichnis wird bei deploy nach WEB-INF/bin/bundle kopiert
* load-bundle greift jetzt darauf zu, nicht mehr auf ccm.bundle.folder und ccm-*-aplaws/bundle
* load tasks sind systematisiert:
  *  load-bundle:  verarbeitet db und config automatisch nach bundle files
  *  load-bundle-interactive:  verarbeitet db und config, fragt required parameter ab
  *  load-bundle-config:  verarbeitet nur config automatisch nach bundle files
  *  load-bundle-config-interactive: verarbeitet nur config, fragt required parameter ab
  *  load-bundle-data:  verarbeitet nur db automatisch nach bundle files

Das ist weiterer Schritt zu einem neuen Installationssystem.


git-svn-id: https://svn.libreccm.org/ccm/trunk@1058 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2011-08-12 10:09:52 +00:00
parent 962227d4e6
commit 98141ba556
5 changed files with 111 additions and 33 deletions

View File

@ -731,6 +731,7 @@ public class Application extends Resource {
return URL.SERVLET_DIR + "/legacy-adapter";
}
@Override
protected void beforeSave() {
if (isPropertyModified(PRIMARY_URL) || isNew()) {
BaseDispatcher.scheduleRefresh();
@ -740,6 +741,7 @@ public class Application extends Resource {
}
// This should be done through PDL
@Override
public void beforeDelete() {
super.beforeDelete();
SiteNode node = getSiteNode();
@ -748,6 +750,7 @@ public class Application extends Resource {
}
}
@Override
public void afterDelete() {
BaseDispatcher.scheduleRefresh();
}
@ -796,6 +799,7 @@ public class Application extends Resource {
// if application name changes, change name of container group
@Override
public void setTitle (String title) {
super.setTitle(title);
Group containerGroup = getGroup();

View File

@ -150,7 +150,7 @@ waf.admin.password=123456
waf.admin.password.question=12345
waf.admin.password.answer=6
waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm?user\=ccm&password\=ccm
waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm-pb?user\=ccm&password\=ccm
waf.runtime.jdbc_pool_size=60
waf.web.server=localhost\:8080

View File

@ -176,6 +176,10 @@
<property value="com.arsdigita.persistence.pdl.PDL" name="ddl.generator.classname"/>
<property value="com.arsdigita.persistence.pdl.TestPDLGenerator" name="test.ddl.generator.classname"/>
<!-- Determines the web.xml file to use. If the project.xml file contains
a ccm:project/webxml property this name is used to search for the file
in later steps. Otherwise the name is set to the stub file web.xml-core
-->
<xsl:choose>
<xsl:when test="@webxml">
<property name="webxml.source.file">
@ -697,7 +701,7 @@
<exclude name="**/package.html"/>
<exclude name="**/*.java"/>
<!-- exclude files which are no longer used - during
transation and code clean-up phase only -->
transition and code clean-up phase only -->
<exclude name="**/*.java.nolongerInUse"/>
<exclude name="**/**.nolongerInUse"/>
</fileset>
@ -816,7 +820,9 @@
<xsl:param name="sourcexml"/>
<mkdir dir="{$name}/${{build.sql.dir}}/${{apps.{$name}.name}}/${{ddl.dir}}/{$database}"/>
<java failonerror="yes" classname="${{ddl.generator.classname}}" fork="yes">
<!-- TESTING
<sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/>
-->
<classpath refid="{$name}.build.classpath"/>
<arg line="-quiet"/>
<arg line="-generate-ddl {$name}/${{build.sql.dir}}/${{apps.{$name}.name}}/${{ddl.dir}}/{$database}"/>
@ -880,7 +886,9 @@
<target name="verify-pdl" depends="init" unless="pdl.no.verify"
description="Verifies that the PDL files compile">
<java classname="${{ddl.generator.classname}}" failonerror="yes" fork="yes">
<!-- TESTING
<sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/>
-->
<classpath refid="server.build.classpath"/>
<arg line="${{pdl.args}}"/>
<xsl:call-template name="TargetPdlPath">
@ -1207,8 +1215,11 @@
</not>
</and>
</condition>
<condition property="resolved.webxml.source.file" value="${{webxml.source.file}}">
<not><isset property="resolved.webxml.source.file"/></not>
<condition property="resolved.webxml.source.file"
value="${{webxml.source.file}}">
<not>
<isset property="resolved.webxml.source.file"/>
</not>
</condition>
<echo message="web.xml to use: ${{this.deploy.dir}}/WEB-INF/${{webxml.source.file}}" />
</target>
@ -1256,12 +1267,41 @@
<delete file="${{mergedWebXML}}"/>
</target>
<target name="copy-bundle-init" depends="init">
<available file="${{ccm.bundle.folder}}" type="dir"
property="root.bundle.exists"/>
<condition property="resolved.bundle.source.dir"
value="${{ccm.bundle.folder}}">
<and>
<isset property="root.bundle.exists"/>
<available file="${{this.deploy.dir}}/WEB-INF/bin"/>
</and>
</condition>
<echo message="Bundle to use: ${{resolved.bundle.source.dir}}" />
</target>
<!-- Copies the installation bundle actually used by this deploy to the
WEB-INF directory of the deploy target so it can be used by the
load-bundle step on the server machine and outside the development
environment. -->
<target name="copy-bundle"
depends="init,copy-bundle-init" if="root.webapp.exists">
<copy todir="${{this.deploy.dir}}/WEB-INF/bin/bundle" overwrite="yes">
<fileset dir="${{resolved.bundle.source.dir}}" />
</copy>
</target>
<!-- Master deploy -->
<target name="deploy"
depends="init,deploy-global,deploy-local,copy-webxml">
depends="init,deploy-global,deploy-local,copy-webxml,copy-bundle">
<xsl:attribute name="description">
Builds and deploys all applications, also deploys prebuilt applications and config files
</xsl:attribute>
<echo>Deploy completed!</echo>
</target>
</xsl:template> <!-- TargetDeploy -->
@ -1531,7 +1571,9 @@
<xsl:param name="sourcexml"/>
<mkdir dir="{$target}/${{build.test.sql.dir}}/${{ddl.dir}}/{$database}"/>
<java failonerror="yes" classname="${{test.ddl.generator.classname}}" fork="yes">
<!-- TESTING
<sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/>
-->
<classpath refid="{$target}.build.classpath"/>
<arg line="-quiet"/>
<arg line="-generate-ddl {$target}/${{build.test.sql.dir}}/{$database}"/>
@ -1863,6 +1905,8 @@
</xsl:for-each>
</target>
<!-- Generates Javadoc from included modules and stores it into its own
subdirectory dir -->
<target name="javadoc" depends="init,javadoc-combine-src"
description="Generates the combined API documentation">
<mkdir dir="${{javadoc.dir}}"/>
@ -1898,6 +1942,7 @@
</javadoc>
</target>
<!-- Deploy junit test environment, currently not uptodate -->
<target name="deploy-test">
<xsl:attribute name="depends">
<xsl:text>init</xsl:text>
@ -2010,17 +2055,20 @@
</xsl:for-each>
<!-- should be deprecated, TODO: check for usage -->
<!-- TESTwise excluded
<path id="ccm.java.ext.dirs">
<!-- no longer present in APLAWS 1.0.4
< ! - - no longer present in APLAWS 1.0.4
<dirset dir="${{ccm.tools.dir}}">
<include name="lib/security"/>
</dirset>
-->
- - >
<pathelement path="${{java.ext.dirs}}"/>
</path>
<pathconvert dirsep="/" pathsep=":" property="ccm.java.ext.dirs"
refid="ccm.java.ext.dirs"/>
-->
<condition property="junit.jvmargs"
value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${{test.remote.port}},
server=y,suspend=y -Xnoagent -Djava.compiler=NONE">

View File

@ -3,35 +3,66 @@
<!-- Already definded:
ccm.project.dir: base dir of the development project
app.server.bundles.zip name of the installation file
app.server.parent.dir name of the dir to install into the server into
app.server.home.dir dir the server are installed into (i.e. CATALINA_HOME)
app.server.deploy.dir dir the server are installed into (i.e. CATALINA_BASE)
app.server.parent.dir name of the dir to install the server into
app.server.home.dir dir the server is installed into (i.e. CATALINA_HOME)
app.server.deploy.dir dir the server is installed into (i.e. CATALINA_BASE)
app.server.conf.dir name of the servers configuration dir
app.server.webapp.dir distribution dir for web applications -->
<project name="load">
<target name="load-bundle" depends="prepare-load">
<echo>Loading bundle ${ccm.bundle.folder} into ${ccm.home}</echo>
<echo>Loading bundle ${this.bundle.folder} into ${ccm.home}</echo>
<java classname="com.arsdigita.packaging.MasterTool" fork="yes">
<java classname="com.arsdigita.packaging.MasterTool" fork="true">
<classpath refid="ccm.classpath" />
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --parameter-file ${ccm.bundle.folder}/cfg/integration.properties" />
<arg line="load ${applications} --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java>
</target>
<target name="load-bundle-interactive" depends="prepare-load">
<echo>Loading bundle ${this.bundle.folder} interactively into ${ccm.home}</echo>
<java classname="com.arsdigita.packaging.MasterTool" fork="true">
<classpath refid="ccm.classpath" />
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java>
</target>
<target name="load-bundle-config" depends="prepare-load">
<echo>load ${applications} --init using ${ccm.bundle.folder}/cfg/integration.properties</echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes">
<echo>load ${applications} --init using ${this.bundle.folder}/cfg/integration.properties</echo>
<java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --config --parameter-file ${ccm.bundle.folder}/cfg/integration.properties" />
<arg line="load ${applications} --config --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java>
</target>
<target name="load-bundle-config-interactive" depends="prepare-load">
<echo>load ${applications} --init using ${this.bundle.folder}/cfg/integration.properties</echo>
<java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true" >
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --config --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java>
</target>
<target name="load-bundle-data" depends="prepare-load">
<echo>load data only executing</echo>
<echo>load --data ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load --data ${applications}" />
</java>
</target>
<target name="load" depends="prepare-load">
<echo>load ${applications} </echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes">
<java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" />
<!--
<sysproperty key="log4j.configuration"
@ -43,26 +74,21 @@
</java>
</target>
<target name="load-data" depends="prepare-load">
<echo>load --data ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes">
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load --data ${applications}" />
</java>
</target>
<target name="load-init" depends="prepare-load">
<echo>load --init ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes">
<java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load --data ${applications}" />
</java>
</target>
<target name="prepare-load">
<echo>prepare bundle ${ccm.bundle.folder}</echo>
<!-- bundle file applications.cfg replace by project.xml, now part of bundle
<copy file="${ccm.bundle.folder}/cfg/applications.cfg"
<property value="${app.server.webapp.dir}/ROOT/WEB-INF/bin/bundle"
name="this.bundle.folder" />
<echo>prepare bundle ${this.bundle.folder}</echo>
<!-- bundle file applications.cfg replaced by project.xml, now part of bundle
<copy file="${this.bundle.folder}/cfg/applications.cfg"
tofile=".tmp.applications.cfg" overwrite="yes" />
<replaceregexp file=".tmp.applications.cfg" match="#.*" replace="" byline="true" />
<replaceregexp file=".tmp.applications.cfg"
@ -71,7 +97,7 @@
<java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true">
<classpath refid="ccm.tools.classpath"/>
<arg value="-IN"/>
<arg value="${ccm.bundle.folder}/cfg/project.xml"/>
<arg value="${this.bundle.folder}/cfg/project.xml"/>
<arg value="-OUT"/>
<arg value=".tmp.applications.list"/>
<arg value="-XSL"/>