Changeset 9622


Ignore:
Timestamp:
2005-04-11T14:31:31+12:00 (19 years ago)
Author:
kjdon
Message:

rearranged the startup targets, added mysql into the prepare target, added a few properties to the build.properties

Location:
branches/ant-install-branch/gsdl3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/build.properties

    r9514 r9622  
    1414# The port number that tomcat is/will be run on
    1515tomcat.port=7070
     16# If tomcat is already running, enter the path to the base directory here
     17tomcat.installed.path=
    1618
    1719## Greenstone 2 collection building options
    1820#The path to Greenstone 2 if it is already installed
    19 gsdl.path=
     21gsdl.installed.path=
     22
     23## Relational database
     24mysql.installed.path=
    2025
    2126## Proxy setup - if Greenstone 3 is running behind a firewall
  • branches/ant-install-branch/gsdl3/build.xml

    r9589 r9622  
    190190tomcat.server=${tomcat.server}
    191191tomcat.port=${tomcat.port}
    192 gsdl.path=${gsdl.path} (this is the location of Greenstone 2 if you have it)
     192tomcat.installed.path=${tomcat.installed.path} (this is the location of Tomcat's base dir if it is already installed)
     193gsdl.installed.path=${gsdl.installed.path} (this is the location of Greenstone 2 if you have it)
    193194proxy.host=${proxy.host}
    194195proxy.port=${proxy.port}
     
    223224      <or>
    224225    <not>
    225       <isset property="gsdl.path"/>
     226      <isset property="gsdl.installed.path"/>
    226227    </not>
    227     <equals arg1="" arg2="${gsdl.path}"/>
     228    <equals arg1="" arg2="${gsdl.installed.path}"/>
     229      </or>
     230    </condition>
     231    <condition property="mysql.islocal">
     232      <or>
     233    <not>
     234      <isset property="mysql.installed.path"/>
     235    </not>
     236    <equals arg1="" arg2="${mysql.installed.path}"/>
     237      </or>
     238    </condition>
     239    <condition property="tomcat.islocal">
     240      <or>
     241    <not>
     242      <isset property="tomcat.installed.path"/>
     243    </not>
     244    <equals arg1="" arg2="${tomcat.installed.path}"/>
    228245      </or>
    229246    </condition>
     
    249266
    250267 <!-- this is all the do-once things -->
    251   <target name="prepare" depends="init,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-collections">
     268  <target name="prepare" depends="init,prepare-packages,prepare-gs2building,prepare-tomcat,prepare-axis,prepare-mysql,prepare-collections">
    252269  </target>
    253270 
     
    335352 
    336353  <!-- this is one target that we only want to run once. -->
    337   <target name="prepare-mysql" depends="init,install-mysql-linux,install-mysql-windows,startup-mysql" unless="mysql.present">
     354  <target name="prepare-mysql" depends="init,install-mysql,startup-mysql" if="mysql.islocal" unless="mysql.present">
    338355    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}">
    339356      <arg value="--user=root"/>
     
    359376  </target>
    360377
     378  <target name="install-mysql" depends="init,install-mysql-linux,install-mysql-windows" if="mysql.islocal"/>
     379 
    361380  <!-- install and set up the database -->
    362   <target name="install-mysql-linux" depends="init" if="current.os.islinux" unless="mysql.present4">
     381  <target name="install-mysql-linux" depends="init" if="current.os.islinux" unless="mysql.present">
    363382    <get src="http://www.greenstone.org/gs3files/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
    364383      dest="${packages.home}/mysql-standard-4.1.11-pc-linux-gnu-i686.tar.gz"
     
    680699  <target name="rename-gs2build-files">
    681700    <copy file="${gs2build.home}/configure.gs2build" tofile="${gs2build.home}/configure"/>   
     701    <chmod file="${gs2build.home}/configure" perm="a+x"/>
    682702    <copy file="${gs2build.home}/configure.in.gs2build" tofile="${gs2build.home}/configure.in"/>
    683703    <copy file="${gs2build.home}/Makefile.in.gs2build" tofile="${gs2build.home}/Makefile.in"/> 
    684704    <copy file="${gs2build.home}/packages/configure.gs2build" tofile="${gs2build.home}/packages/configure"/>
     705    <chmod file="${gs2build.home}/packages/configure" perm="a+x"/>
    685706    <copy file="${gs2build.home}/packages/Makefile.gs2build" tofile="${gs2build.home}/packages/Makefile"/>
    686707    <copy file="${gs2build.home}/lib/Makefile.in.gs2build" tofile="${gs2build.home}/lib/Makefile.in"/> 
     708   
    687709  </target>
    688710  <target name="prepare-gli" depends="init" if="gsdl2.islocal" unless="gli.present">
     
    789811  </target>
    790812
    791   <target name="startup" description="Launch Greenstone (Tomcat and Mysql)" depends="init">
     813  <target name="startup" description="Launch the Greenstone servers (tomcat,mysql...)" depends="init,startup-mysql,startup-tomcat"/>
     814
     815  <target name="startup-tomcat" description="Launch Tomcat" depends="init" if="tomcat.islocal">
    792816    <property name="tomcat.classpath" refid="compile.classpath"/>
    793817    <property name="tomcat.path" value="${basedir}/packages/mysql/bin:${basedir}/bin/script:${basedir}/bin:${env.PATH}"/>
     
    817841  </target>
    818842
    819   <target name="shutdown" description="Shutdown Greenstone (Tomcat and Mysql)" depends="init">
     843  <target name="shutdown" depends="init,shutdown-tomcat,shutdown-mysql" description="Shutdown all the local servers"/>
     844 
     845  <target name="shutdown-tomcat" description="Shutdown Greenstone (Tomcat and Mysql)" depends="init" if="tomcat.islocal">
    820846    <exec executable="${catalina.home}/bin/shutdown.sh" os="${os.linux}" dir="${catalina.home}/bin" spawn="false"/>
    821847  </target>
     
    925951
    926952  <!-- mysql targets -->
    927   <target name="startup-mysql" depends="init">
     953  <target name="startup-mysql" depends="init" if="mysql.islocal">
    928954    <exec executable="${mysql.home}/bin/mysqld_safe" dir="${mysql.home}"
    929955      spawn="true">
     
    936962    </exec>
    937963    <sleep seconds="2"/>
    938   </target>
    939 
    940   <target name="shutdown-mysql" depends="init">
    941     <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}">
     964    <!-- need to test that the server has started up -->   
     965    <exec executable="${mysql.home}/bin/mysql" dir="${mysql.home}"
     966      failonerror="true" outputproperty="throw.away">
     967      <arg value="--user=root"/>
     968      <arg value="--execute=show databases;"/>
     969    </exec>
     970    <echo>MYSQL database server started successfully</echo>
     971  </target>
     972
     973  <target name="shutdown-mysql" depends="init" if="mysql.islocal">
     974    <exec executable="${mysql.home}/bin/mysqladmin" dir="${mysql.home}"
     975      failonerror="true">
    942976      <arg value="--user=root"/>
    943977      <arg value="--socket=/tmp/mysql.sock"/>
    944978      <arg value="shutdown"/>
    945979    </exec>
     980    <echo>MYSQL database server shutdown successfully</echo>
    946981  </target>
    947982
Note: See TracChangeset for help on using the changeset viewer.