Shell script commands to install and build the VOSpace 2008.2.02 release on an Ubuntu 8.04 machine.

    #
    # Need to run the package installs as root.
    sudo su -

        #
        # Update the package list.
        apt-get update

        #
        # Install the Java JDK.
        apt-get -y install openjdk-6-jdk

        #
        # Install misc things that we need later.
        apt-get -y install tar
        apt-get -y install wget
        apt-get -y install unzip

        #
        # Install the database server.
        apt-get -y install postgresql

        #
        # Create the 'vospace' database account.
        # (you will be asked to enter the password)
        su postgres -c "createuser --no-superuser --no-createdb --no-createrole --pwprompt vospace"

        #
        # Create the 'junit' database account.
        # (you will be asked to enter the password)
        su postgres -c "createuser --no-superuser --no-createdb --no-createrole --pwprompt junit"

        #
        # Create a database called 'vospacetest_2008_2_02', owned by the 'vospace' user.
        su postgres -c "createdb --owner vospace vospacetest_2008_2_02"
        #
        # Grant access to the 'junit' user account.
        su postgres -c "psql vospacetest_2008_2_02 postgres -c 'GRANT ALL ON DATABASE vospacetest_2008_2_02 TO junit'"

        #
        # Exit back to normal user.
        exit

Create an environment variable with the password you set for the junit database account.

    #
    # Set the database password to match the password for the database user account.
    SECRET=wibble

Install the Maven build tool.

    #
    # Create a local Maven directory.
    mkdir ~/maven

    #
    # Download and unzip Maven 1.0.2
    pushd ~/maven
        wget http://www.metagrid.co.uk/maven/maven/zips/maven-1.0.2.tar.gz
        tar -xvzf maven-1.0.2.tar.gz 
    popd

    #
    # Set the Java location (old style).
    export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

    #
    # Test run of Maven.
    ~/maven/maven-1.0.2/bin/maven
         __  __
        |  \/  |__ _Apache__ ___
        | |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
        |_|  |_\__,_|\_/\___|_||_|  v. 1.0.2

        Plugin cache will be regenerated
        BUILD SUCCESSFUL

Download the VOSpace source code.

    #
    # Create a local vospace directory.
    mkdir ~/vospace

    #
    # Download and unzip the VOSpace source code.
    pushd ~/vospace
        wget -O vospace-2008.2.02.zip 'http://esavo02.esac.esa.int/trac/VOSpace/changeset/1463/branches/release-2008.2.02?old_path=%2F&format=zip'
        unzip vospace-2008.2.02.zip
    popd

    #
    # Set the branch root.
    VOSPACE_BUILD=~/vospace/branches/release-2008.2.02

    #
    # Set the database password.
    pushd ${VOSPACE_BUILD}
        for config in `find . -name hibernate.cfg.xml`
        do
            echo "Updating database password in ${config}"
            sed -i '
                /<property name="connection.password">/ {
                    s|>.*<|>'"$SECRET"'<|
                    }
            ' ${config}
        done
    popd

    #
    # Set the build version to SNAPSHOT.
    pushd ${VOSPACE_BUILD}
        for properties in `find -L . -name project.properties`
        do
            echo "Updating build version in ${properties}"
            sed -i '
                /^vospace.version=/ c vospace.version=SNAPSHOT
            ' $properties
        done
    popd

Run maven to build each of the components.

    #
    # Build the util and junit components.
    pushd ${VOSPACE_BUILD}/util
        ~/maven/maven-1.0.2/bin/maven
    popd
    pushd ${VOSPACE_BUILD}/junit
        ~/maven/maven-1.0.2/bin/maven
    popd

    #
    # Build the core server.
    pushd ${VOSPACE_BUILD}/server
        ~/maven/maven-1.0.2/bin/maven
    popd

    #
    # Build the webapp servlet.
    pushd ~/vospace/trunk/webapp/servlet
        ~/maven/maven-1.0.2/bin/maven
    popd

    #
    # Build the MySpace components.
    pushd ${VOSPACE_BUILD}/webapp/myspace/schema
        ~/maven/maven-1.0.2/bin/maven
    popd
    pushd ${VOSPACE_BUILD}/webapp/myspace/service
        ~/maven/maven-1.0.2/bin/maven
    popd

    #
    # Build the VOSpace-1.0 components.
    pushd ${VOSPACE_BUILD}/webapp/vospace-1.0/schema
        ~/maven/maven-1.0.2/bin/maven
    popd
    pushd ${VOSPACE_BUILD}/webapp/vospace-1.0/service
        ~/maven/maven-1.0.2/bin/maven
    popd

    #
    # Build the VOSpace-1.1 components.
    pushd ${VOSPACE_BUILD}/webapp/vospace-1.1/schema
        ~/maven/maven-1.0.2/bin/maven
    popd
    pushd ${VOSPACE_BUILD}/webapp/vospace-1.1/service
        ~/maven/maven-1.0.2/bin/maven
    popd

    #
    # Build the webapp.
    pushd ${VOSPACE_BUILD}/webapp/webapp
        ~/maven/maven-1.0.2/bin/maven
    popd

-- DaveMorris - 06 Jan 2009

Topic revision: r2 - 2009-01-09 - 14:26:35 - DaveMorris
 
AstroGrid Service Click here for the
AstroGrid Service Web
This is the AstroGrid
Development Wiki

This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback