Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

Info

If you would prefer to install DuraCloud from a binary distribution, you can find instructions for that process here.

...

  1. Maven 2.2.1 or above
  2. Tomcat 6.x or above
  3. Java 6 7 (note: the djatoka service has compatibility issues with open-jdk)
  4. Subversion

...

Build and deploy the DuraCloud web applications
  1. Check out latest stable release from Subversion repository

    Code Block
    
    svn co https://svn.duraspace.org/duracloud/tags/duracloud-2.1.0
    
  2. Set environment variables

    Code Block
    
    export JAVA_OPTS="-XX:MaxPermSize=256m"
    export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=1024m"
    
  3. Configure Tomcat
    1. Add to $CATALINA_HOME/conf/tomcat-users.xml

      No Format
      
      <tomcat-users>
        <role rolename="manager"/>
        <role rolename="admin"/>
        <user username="[ANY-USERNAME]" password="[ANY-PASSWORD]" roles="admin,manager"/>
      </tomcat-users>
      
  4. Start tomcat

    Code Block
    
    $CATALINA_HOME/bin/startup.sh
    
  5. Configure Maven2
    1. Add tomcat user to $M2_HOME/conf/settings.xml

      No Format
      
      <servers>
        <server>
          <id>tomcat-server</id>
          <username>[ANY-USERNAME]</username>
          <password>[ANY-PASSWORD]</password>
        </server>
      </servers>
      
  6. Build
    1. From top of source tree

      Code Block
      
      mvn clean install
      
Set up the OSGi services container

This step assumes the successful completion of the previous build instructions

Panel
titleLinux/Mac
  1. Start OSGi service container

    Code Block
    
    cd //services/servicesadmin
    mvn clean -f pom-run.xml pax:provision
    cd runner
    chmod +x run.sh
    export BUNDLE_HOME=[DURACLOUD_HOME]/osgi-container
    ./run.sh
    
    1. Where [DURACLOUD_HOME] is a directory where the application has write access (can be same as <duracloud.home> set in Maven settings.xml above)
    2. The run.sh script will start an OSGi container and commandline interface to it
    3. The container starts with required bundles including the 'services-admin' installed
Panel
titleWindows
  1. Set up OSGi service container

    Code Block
    
    cd services/servicesadmin
    mvn clean -f pom-run.xml pax:provision
    cd runner
    
  2. (Optional) Set the OSGi bundle storage location

    Code Block
    
    set BUNDLE_HOME=[BUNDLE_HOME]
    
    1. Where [BUNDLE_HOME] is the full path to an empty directory where the osgi container content will be stored
    2. Open the run.bat file in the runner directory in a text editor and replace all instances of "$BUNDLE_HOME" with "%BUNDLE_HOME%"
    3. Note: A directory called "$BUNDLE_HOME" under the runner directory will be used as the default bundle home if one is not specified.
  3. (Optional) Set up logging
    1. Download the logback.xml file found here into your bundle home directory.
    2. Open the logback.xml file in a text editor and edit the LOG_FILENAME property to point to a full file path (including file name) for a log file.
    3. Note: One benefit to performing this step will be faster start time for your OSGi container.
  4. Start OSGI service container

    Code Block
    
    run.bat
    
    1. The run.bat script will start an OSGi container and commandline interface to it
    2. The container starts with required bundles including the 'services-admin' installed

...

  1. Use the application initialization (app-config) utiltiy to configure the deployed DuraCloud applications
    1. Build app-config utility, from within the //app-config module

      Code Block
      
      mvn assembly:assembly
      
    2. Run the app-config utility

      Code Block
      
      java -jar target/app-config-[VERSION]-driver.jar <init.props>
      
      1. The init.props file is a configuration file which specifies all of the information necessary for the DuraCloud applications to run. An example of this file can be found at //app-config/src/main/resources/init.props. This file will need to be updated to match your environment.
    3. When the app-config utility completes successfully, the last line of output printed to the console will be the word "success". If this is not the case, check that your configuration file includes the correct information.

...

Optional items

Code coverage
  1. If you plan on using Clover, the following element needs to be added to your maven 'settings.xml'

    No Format
    
    <profiles>
      <profile>
        <id>profile-clover</id>
        <activation>
          <property>
            <name>profile</name>
            <value>clover</value>
          </property>
        </activation>
        <properties>
          <cloverLicense>[LOCATION-OF-clover.license-FILE]</cloverLicense>
        </properties>
      </profile>
    </profiles>
    
  2. To run clover

    Code Block
    
    mvn clover2:instrument clover2:aggregate clover2:clover -Pprofile-clover
    
  3. A report will be generated in the following directory:
    //target/site/clover/

...

  1. Assuming that the OSGi services container is set up and running (as described above), tests that deploy services into the OSGi environment may be run
    1. From inside the //integration-test module

      Code Block
      
      mvn install -PrunServicesAdminTests
      

...

  1. This tool provides a commandline interface for interacting with the 'services-admin' installed in a running OSGi container (see notes above for starting the container)
  2. To build and run the CLI, from within the //servicesadminclient module

    Code Block
    
    mvn assembly:assembly
    java -cp target/servicesadminclient-[VERSION]-cli.jar
    
Building Java client packages
  1. To create a distributable zip of the storeclient, serviceclient, or reportclient which includes their dependencies, from within the project directory (//storeclient, //serviceclient, //reportclient) run

    Code Block
    
    mvn install -Ppackage-client
    
  2. The packaged zip will be found under the project's target directory

...