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

@@ -114,6 +114,7 @@ Common usage:
<!-- Print some useful help text --> <!-- Print some useful help text -->
<!-- ============================================================= --> <!-- ============================================================= -->
<target name="help"> <target name="help">
<echo message="" /> <echo message="" />
<echo message="DSpace configuration file" /> <echo message="DSpace configuration file" />
<echo message="-----------------------------------" /> <echo message="-----------------------------------" />
@@ -123,20 +124,74 @@ Common usage:
<echo message="update --> Update installed code without touching your config or data" /> <echo message="update --> Update installed code without touching your config or data" />
<echo message="" /> <echo message="" />
<echo message="init_configs --> Write the configuration files to ${dspace.dir}/config" /> <echo message="init_configs --> Write the configuration files to ${dspace.dir}/config" />
<echo message="install_code --> Install compiled code into ${dspace.dir}" />
<echo message="" /> <echo message="" />
<echo message="fresh_install --> Perform a fresh installation of the software, including the databases &amp; config" /> <echo message="fresh_install --> Perform a fresh installation of the software, including the databases &amp; config" />
<echo message="setup_database --> Create database tables" /> <echo message="setup_database --> Create database tables" />
<echo message="load_registries --> Load metadata &amp; file format registries into the database" /> <echo message="load_registries --> Load metadata &amp; file format registries into the database" />
<echo message="" /> <echo message="" />
<echo message="clean_database --> Remove DSpace database tables, destroying data" /> <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)">
<tstamp>
<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>
<echo>
====================================================================
${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"> <copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config/language-packs" /> <fileset dir="config/language-packs" />
@@ -147,7 +202,13 @@ Common usage:
Copied language packs into ${dspace.dir}/config 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,7 +267,7 @@ 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">
@@ -186,13 +279,9 @@ Copied language packs into ${dspace.dir}/config
<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,13 +293,9 @@ 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"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" /> <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" /> <sysproperty key="dspace.configuration" value="${config}" />
<arg value="etc/database_schema.sql" /> <arg value="etc/database_schema.sql" />
@@ -226,13 +311,9 @@ 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"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" /> <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" /> <sysproperty key="dspace.configuration" value="${config}" />
<arg value="etc/clean-database.sql" /> <arg value="etc/clean-database.sql" />
@@ -246,23 +327,16 @@ 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"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" /> <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" /> <sysproperty key="dspace.configuration" value="${config}" />
<arg value="-bitstream" /> <arg value="-bitstream" />
<arg value="${dspace.dir}/config/registries/bitstream-formats.xml" /> <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"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" /> <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" /> <sysproperty key="dspace.configuration" value="${config}" />
<arg value="-dc" /> <arg value="-dc" />
@@ -276,31 +350,40 @@ 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" />
</copy>
<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="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" /> <sysproperty key="dspace.configuration" value="${config}" />
<arg value="-installTemplates" /> <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"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" /> <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" /> <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"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" /> <sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" /> <sysproperty key="dspace.configuration" value="${config}" />
</java> </java>
@@ -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>