Ignore:
Timestamp:
06/05/13 21:38:27 (8 years ago)
Author:
ak19
Message:

Beginnings of changes to make the diffcol task use a standalone Greenstone. At present still only has support for GS2. Mails with reports as attachments are now being sent to the greenstone mailing address without any noticeable code changes there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/diffcol/trunk/task

    r27542 r27557  
    88export UPLOAD_DIR=$TASK_HOME/diffcol-reports
    99export MONITOR_EMAIL=greenstone_team@cs.waikato.ac.nz
     10
     11# control if an existing compiled greenstone is used
     12# or, if one should be checked out, which revision to checkout from svn
     13SVN_OPT_R="-r head"
     14#export GSDLHOME=
     15#export GSDL3SRCHOME=
    1016
    1117#check key environment vars are set
     
    4753xmlout=$DATA_DIR'/full-report-'$dateid'.xml'
    4854
     55# the toplevel folder of the greenstone installation being used
     56greenstone_home=
     57# gsdl is the checkout folder and can be greenstone2 or greenstone3
     58gsdl=greenstone2
     59
     60
     61# Check if using existing compiled-up greenstone installation
     62# and set the greenstone_home location accordingly
     63if [ "x$GSDL3SRCHOME" != "x" -o "x$GSDLHOME" != "x" ]; then
     64    echo "Found existing Greenstone home, will use that instead"
     65    greenstone_home=$GSDLHOME
     66else
     67    greenstone_home="$DATA_DIR/$gsdl";
     68fi
     69
     70
     71
    4972function setup_greenstone() {
    5073
     
    6285    cd $DATA_DIR
    6386
     87
     88        # use existing compiled-up greenstone installation
     89    if [ "x$GSDL3SRCHOME" != "x" -o "x$GSDLHOME" != "x" ]; then
     90        echo "Found existing Greenstone home, will use that instead"
     91        return;
     92    fi
     93
     94    # Else checkout a GS from svn into DATA_DIR
     95
     96
    6497    #svn checkout of main gsdl directory
    65     echo "checkout gsdl:"
    66     svn co http://svn.greenstone.org/main/trunk/greenstone2 gsdl
    67     echo "done"
    68 
    69     cd $DATA_DIR/gsdl
     98    echo "checkout $gsdl:"
     99    svn co $SVN_OPT_REV http://svn.greenstone.org/main/trunk/greenstone2 $gsdl
     100    echo "done"
     101
     102    cd $DATA_DIR/$gsdl
    70103
    71104
     
    81114        gl_suffix=$os'-intel';
    82115    else
    83         # linux, worl out the bit arch
     116        # linux, work out the bit architecture
    84117        arch=`uname -m`
    85118        if [[ "$arch" == *"64"* ]]; then
     
    93126
    94127    #svn checkout gnome-lib for this linux/darwin
    95     cd $DATA_DIR/gsdl/ext
     128    cd $DATA_DIR/$gsdl/ext
    96129
    97130#   svn export http://svn.greenstone.org/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-linux-x64.tar.gz gl.tar.gz
     
    105138
    106139    #configure
    107     echo "configure gsdl: "
     140    echo "configure $gsdl: "
    108141    echo "<configure>" >> $xmlout
    109142    ./configure 2>> $DATA_DIR/compilation-errors
     
    112145
    113146    #make
    114     echo "make gsdl: "
     147    echo "make $gsdl: "
    115148    echo "<make>" >> $xmlout
    116149    make 2>> $DATA_DIR/compilation-errors
     
    119152
    120153    #make install
    121     echo "make install gsdl: "
     154    echo "make install $gsdl: "
    122155    echo "<make-install>" >> $xmlout
    123156    make install $DATA_DIR/compilation-errors
     
    125158    echo "done"
    126159
    127 
     160    # set the path to the greenstone_home variable
     161    greenstone_home=$DATA_DIR/$gsdl
    128162}
    129163
     
    134168    echo '<test time="'$dateid'" id="'$dateid'">' > $xmlout
    135169
    136     cd $DATA_DIR/gsdl
     170    # go to whichever greenstone_home we're using
     171    cd $greenstone_home
    137172
    138173    #get svn info
     
    144179
    145180    #set up the gsdl environment with the setup.bash script
    146     echo "setting up gsdl environment: "
     181    echo "setting up $gsdl environment: "
    147182        export GSDLHOME=
    148183        source setup.bash
     
    154189
    155190    #copy the model collections to the collect folder to be rebuilt
    156     echo -n "installing test collections and model collections to new gsdl installation... "
     191    echo -n "installing test collections and model collections to new $gsdl installation... "
    157192
    158193        #clean up
     
    209244        cd $TASK_HOME/diffcol
    210245        ./diffcol.pl -output xml -verbosity 10 $collection >> $xmlout
    211         cd $DATA_DIR/gsdl
     246        cd $greenstone_home
    212247        echo "done"
    213248
     
    256291    echo "result: "$result
    257292    if [ "$result" != "yes" ]; then
    258     echo 'gsdl regression test for '$dateid' failed' | mutt -a $DATA_DIR'/report-'$dateid'.html' -s 'Regression Test Failed' -- $MONITOR_EMAIL
     293    echo $gsdl' regression test for '$dateid' failed' | mutt -a $DATA_DIR'/report-'$dateid'.html' -s 'Regression Test Failed' -- $MONITOR_EMAIL
    259294    fi
    260295    echo "Sent mail with report attached."
     
    274309
    275310}
     311
    276312
    277313#parse arguments
Note: See TracChangeset for help on using the changeset viewer.