Reintroduce functionality available via "install_code" target

git-svn-id: http://scm.dspace.org/svn/repo/trunk@1987 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2007-05-31 15:57:56 +00:00
parent 2f07826c94
commit f69689a454

View File

@@ -65,7 +65,7 @@ Common usage:
<!-- Will be using various environment variables --> <!-- Will be using various environment variables -->
<!-- ============================================================= --> <!-- ============================================================= -->
<property environment="env"/> <property environment="env" />
<!-- ============================================================= --> <!-- ============================================================= -->
@@ -88,7 +88,7 @@ Common usage:
<loadproperties srcFile="${config}"> <loadproperties srcFile="${config}">
<filterchain> <filterchain>
<linecontainsregexp> <linecontainsregexp>
<regexp pattern="^\s*dspace\.dir\s+"/> <regexp pattern="^\s*dspace\.dir\s+" />
</linecontainsregexp> </linecontainsregexp>
</filterchain> </filterchain>
</loadproperties> </loadproperties>
@@ -103,9 +103,9 @@ Common usage:
<!-- We will include the environment CLASSPATH --> <!-- We will include the environment CLASSPATH -->
<path id="class.path"> <path id="class.path">
<pathelement path="${env.CLASSPATH}"/> <pathelement path="${env.CLASSPATH}" />
<fileset dir="lib"> <fileset dir="lib">
<include name="**/*.jar"/> <include name="**/*.jar" />
</fileset> </fileset>
</path> </path>
@@ -114,40 +114,101 @@ Common usage:
<!-- Print some useful help text --> <!-- Print some useful help text -->
<!-- ============================================================= --> <!-- ============================================================= -->
<target name="help"> <target name="help">
<echo message=""/>
<echo message="DSpace configuration file"/> <echo message="" />
<echo message="-----------------------------------"/> <echo message="DSpace configuration file" />
<echo message=""/> <echo message="-----------------------------------" />
<echo message="Available targets are:"/> <echo message="" />
<echo message=""/> <echo message="Available targets are:" />
<echo message="update --> Update installed code without touching your config or data"/> <echo message="" />
<echo message=""/> <echo message="update --> Update installed code without touching your config or data" />
<echo message="init_configs --> Write the configuration files to ${dspace.dir}/config"/> <echo message="" />
<echo message=""/> <echo message="init_configs --> Write the configuration files to ${dspace.dir}/config" />
<echo message="fresh_install --> Perform a fresh installation of the software, including the databases &amp; config"/> <echo message="install_code --> Install compiled code into ${dspace.dir}" />
<echo message="setup_database --> Create database tables"/> <echo message="" />
<echo message="load_registries --> Load metadata &amp; file format registries into the database"/> <echo message="fresh_install --> Perform a fresh installation of the software, including the databases &amp; config" />
<echo message=""/> <echo message="setup_database --> Create database tables" />
<echo message="clean_database --> Remove DSpace database tables, destroying data"/> <echo message="load_registries --> Load metadata &amp; file format registries into the database" />
<echo message="" />
<echo message="clean_database --> Remove DSpace database tables, destroying data" />
</target> </target>
<!-- ============================================================= --> <!-- ============================================================= -->
<!-- Update an installation (except database) --> <!-- Update an installation (except database) -->
<!-- ============================================================= --> <!-- ============================================================= -->
<target name="update" <target name="update" description="Update installed code (without clobbering data/config)">
description="Update installed code (without clobbering data/config)">
<copy todir="${dspace.dir}/config" preservelastmodified="true"> <tstamp>
<fileset dir="config/language-packs"/> <format property="build.date" pattern="yyyyMMdd-HHmmss" />
</tstamp>
<copy todir="${dspace.dir}/bin" preservelastmodified="true">
<fileset dir="bin" />
</copy>
<chmod dir="${dspace.dir}/bin" perm="u+x" includes="**/*" />
<mkdir dir="${dspace.dir}/lib.bak-${build.date}"/>
<move todir="${dspace.dir}/lib.bak-${build.date}">
<fileset dir="${dspace.dir}/lib">
<include name="**/*"/>
</fileset>
</move>
<copy todir="${dspace.dir}/lib" preservelastmodified="true">
<fileset dir="lib" />
</copy> </copy>
<echo> <echo>
==================================================================== ====================================================================
Copied language packs into ${dspace.dir}/config ${dspace.dir}/lib was backed up to
${dspace.dir}/lib.bak-${build.date}
Please review this directory and delete it if its no longer needed.
====================================================================
</echo>
<mkdir dir="${dspace.dir}/webapps.bak-${build.date}"/>
<move todir="${dspace.dir}/webapps.bak-${build.date}">
<fileset dir="${dspace.dir}/webapps">
<include name="**/*.war"/>
</fileset>
</move>
<copy todir="${dspace.dir}/webapps" preservelastmodified="true">
<fileset dir="webapps" />
</copy>
<echo>
====================================================================
${dspace.dir}/webapps was backed up to
${dspace.dir}/webapps.bak-${build.date}
Please review this directory and delete it if its no longer needed.
====================================================================
</echo>
<copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config/language-packs" />
</copy>
<echo>
====================================================================
Copied language packs into ${dspace.dir}/config
==================================================================== ====================================================================
Updated Web application (.war) files are in the 'build' directory. </echo>
<echo>
====================================================================
Updated Web application (.war) files are in the '${dspace.dir}/webapps'
directory.
* Stop your Web servlet container (Tomcat, Jetty, Resin etc.) * Stop your Web servlet container (Tomcat, Jetty, Resin etc.)
@@ -163,6 +224,38 @@ Copied language packs into ${dspace.dir}/config
* Start up your Web servlet container again. * Start up your Web servlet container again.
==================================================================== ====================================================================
</echo> </echo>
</target>
<!-- ============================================================= -->
<!-- Install DSpace and Dependencies -->
<!-- ============================================================= -->
<target name="init_installation">
<mkdir dir="${dspace.dir}/bin" />
<mkdir dir="${dspace.dir}/config" />
<mkdir dir="${dspace.dir}/lib" />
<mkdir dir="${dspace.dir}/webapps" />
<mkdir dir="${assetstore.dir}" />
<mkdir dir="${handle.dir}" />
<mkdir dir="${history.dir}" />
<mkdir dir="${search.dir}" />
<mkdir dir="${log.dir}" />
<mkdir dir="${upload.temp.dir}" />
<mkdir dir="${report.dir}" />
</target> </target>
@@ -174,25 +267,21 @@ Copied language packs into ${dspace.dir}/config
run the install-configs script. The "log4j.build.properties" file is run the install-configs script. The "log4j.build.properties" file is
copied to ${dspace.dir}/config so there's a simple log4j.properties copied to ${dspace.dir}/config so there's a simple log4j.properties
file present for the initial run of "install-configs". --> file present for the initial run of "install-configs". -->
<target name="init_configs"> <target name="init_configs" depends="init_installation">
<copy todir="${dspace.dir}/config" preservelastmodified="true"> <copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config"> <fileset dir="config">
<exclude name="language-packs/**"/> <exclude name="language-packs/**" />
</fileset> </fileset>
</copy> </copy>
<copy todir="${dspace.dir}/config" preservelastmodified="true"> <copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config/language-packs"/> <fileset dir="config/language-packs" />
</copy> </copy>
<copy file="etc/log4j.build.properties" <copy file="etc/log4j.build.properties" tofile="${dspace.dir}/config/log4j.properties" preservelastmodified="true" />
tofile="${dspace.dir}/config/log4j.properties"
preservelastmodified="true"/>
<copy file="${config}" <copy file="${config}" tofile="${dspace.dir}/config/dspace.cfg" preservelastmodified="true" />
tofile="${dspace.dir}/config/dspace.cfg"
preservelastmodified="true" />
</target> </target>
@@ -204,16 +293,12 @@ Copied language packs into ${dspace.dir}/config
<!-- We execute InitializeDatabase, passing in the simple log4j properties <!-- We execute InitializeDatabase, passing in the simple log4j properties
- file in etc/ and the DSpace configuration file using system - file in etc/ and the DSpace configuration file using system
- properties --> - properties -->
<target name="setup_database" <target name="setup_database" description="Create database tables">
description="Create database tables">
<java classname="org.dspace.storage.rdbms.InitializeDatabase" <java classname="org.dspace.storage.rdbms.InitializeDatabase" classpathref="class.path" fork="yes" failonerror="yes">
classpathref="class.path" <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
fork="yes" <sysproperty key="dspace.configuration" value="${config}" />
failonerror="yes"> <arg value="etc/database_schema.sql" />
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="etc/database_schema.sql"/>
</java> </java>
</target> </target>
@@ -226,16 +311,12 @@ Copied language packs into ${dspace.dir}/config
<!-- We execute InitializeDatabase, passing in the simple log4j properties <!-- We execute InitializeDatabase, passing in the simple log4j properties
- file in etc/ and the DSpace configuration file using system - file in etc/ and the DSpace configuration file using system
- properties --> - properties -->
<target name="clean_database" <target name="clean_database" description="Removes DSpace database tables, destroying data">
description="Removes DSpace database tables, destroying data">
<java classname="org.dspace.storage.rdbms.InitializeDatabase" <java classname="org.dspace.storage.rdbms.InitializeDatabase" classpathref="class.path" fork="yes" failonerror="yes">
classpathref="class.path" <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
fork="yes" <sysproperty key="dspace.configuration" value="${config}" />
failonerror="yes"> <arg value="etc/clean-database.sql" />
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="etc/clean-database.sql"/>
</java> </java>
</target> </target>
@@ -246,27 +327,20 @@ Copied language packs into ${dspace.dir}/config
<!-- ============================================================= --> <!-- ============================================================= -->
<!-- Loads bitstream format and Dublin Core type registries --> <!-- Loads bitstream format and Dublin Core type registries -->
<target name="load_registries" <target name="load_registries" description="Load initial contents of registries">
description="Load initial contents of registries">
<java classname="org.dspace.administer.RegistryLoader" <java classname="org.dspace.administer.RegistryLoader" classpathref="class.path" fork="yes" failonerror="yes">
classpathref="class.path" <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
fork="yes" <sysproperty key="dspace.configuration" value="${config}" />
failonerror="yes"> <arg value="-bitstream" />
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/> <arg value="${dspace.dir}/config/registries/bitstream-formats.xml" />
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="-bitstream"/>
<arg value="${dspace.dir}/config/registries/bitstream-formats.xml"/>
</java> </java>
<java classname="org.dspace.administer.RegistryLoader" <java classname="org.dspace.administer.RegistryLoader" classpathref="class.path" fork="yes" failonerror="yes">
classpathref="class.path" <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
fork="yes" <sysproperty key="dspace.configuration" value="${config}" />
failonerror="yes"> <arg value="-dc" />
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/> <arg value="${dspace.dir}/config/registries/dublin-core-types.xml" />
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="-dc"/>
<arg value="${dspace.dir}/config/registries/dublin-core-types.xml"/>
</java> </java>
</target> </target>
@@ -276,33 +350,42 @@ Copied language packs into ${dspace.dir}/config
<!-- Do a fresh system install --> <!-- Do a fresh system install -->
<!-- ============================================================= --> <!-- ============================================================= -->
<target name="fresh_install" <target name="fresh_install" depends="init_installation,init_configs,setup_database,load_registries" description="Do a fresh install of the system, overwriting any data">
depends="init_configs,setup_database,load_registries"
description="Do a fresh install of the system, overwriting any data">
<java classname="org.dspace.core.ConfigurationManager" <delete dir="${dspace.dir}/bin" includes="**/*" />
classpathref="class.path"
fork="yes" <copy todir="${dspace.dir}/bin" preservelastmodified="true">
failonerror="yes"> <fileset dir="bin" />
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/> </copy>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="-installTemplates"/> <chmod dir="${dspace.dir}/bin" perm="u+x" includes="**/*" />
<delete dir="${dspace.dir}/lib" includes="**/*" />
<copy todir="${dspace.dir}/lib" preservelastmodified="true">
<fileset dir="lib" />
</copy>
<delete dir="${dspace.dir}/webapps" includes="**/*" />
<copy todir="${dspace.dir}/webapps" preservelastmodified="true">
<fileset dir="webapps" />
</copy>
<java classname="org.dspace.core.ConfigurationManager" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
<arg value="-installTemplates" />
</java> </java>
<java classname="org.dspace.browse.InitializeBrowse" <java classname="org.dspace.browse.InitializeBrowse" classpathref="class.path" fork="yes" failonerror="yes">
classpathref="class.path" <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
fork="yes" <sysproperty key="dspace.configuration" value="${config}" />
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
</java> </java>
<java classname="org.dspace.search.DSIndexer" <java classname="org.dspace.search.DSIndexer" classpathref="class.path" fork="yes" failonerror="yes">
classpathref="class.path" <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
fork="yes" <sysproperty key="dspace.configuration" value="${config}" />
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
</java> </java>
<echo> <echo>
@@ -330,6 +413,7 @@ Copied language packs into ${dspace.dir}/config
${dspace.url}/dspace-admin ${dspace.url}/dspace-admin
==================================================================== ====================================================================
</echo> </echo>
</target> </target>
</project> </project>