Changeset 4819


Ignore:
Timestamp:
07/27/10 07:49:31 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added folds in nightlyrun

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/cron/nightlyrun.sh

    r4729 r4819  
    44
    55#some functions
    6 function timer()
     6function timer() #{{{1
    77{
    88        if [[ $# -eq 0 ]]; then
     
    2020                printf '%d:%02d:%02d' $dh $dm $ds
    2121        fi
    22 }
    23 function todaydate()
     22} #}}}
     23function todaydate() #{{{1
    2424{
    2525        suffix=`date | awk '{printf("%s-%s-%s  %s",$2,$3,$6,$4);}'`                     
    2626        echo $suffix;                   
    27 }
    28 function host_name()
     27} #}}}
     28function host_name() #{{{1
    2929{
    3030        #return host name depending on the OS
     
    3636        fi
    3737        echo $HOST_NAME;
    38 }
    39 
    40 #get configs
     38} #}}}
     39
     40#Get configuration
     41#Source config file{{{1
    4142if [ $# -ne 1 ];
    4243then
    4344        #no config file specified: exit
    44         echo "no config file specified. Exiting..."
     45        echo "no config file specified. Exiting..." >&2 # Error message to stderr.
    4546        exit 1
    4647fi
     48if [ ! -f "$1" ]
     49then
     50        echo "File $1 not found!" >&2   # Error message to stderr.
     51        exit 1
     52fi
    4753source $1;
     54#}}}
     55#Export ISSM_* variables{{{1
    4856export ISSM_DIR
    4957export ISSM_ARCH
    50 
    51 #launch nightly run (get start time)
     58#}}}
     59#Initialize variables {{{1
    5260TODAY=$(todaydate);
    5361HOST_NAME=$(host_name $OS);
     
    5664USER=$(whoami);
    5765INIT_PATH=$(pwd);
    58 
    59 #Checkout and install ISSM if required
     66#}}}
     67
     68#Lauch installation
     69#Checkout and install ISSM if requested (SKIPINSTALLATION){{{1
    6070if [ "$SKIPINSTALLATION" != "yes" ]
    6171then
     
    8191END
    8292
    83         #Install external packages
     93        #Compile external packages if requested    (SKIPPACKAGESCOMPILATION){{{2
    8494        if [ "$SKIPPACKAGESCOMPILATION"  = "yes" ]
    8595        then
     
    117127                cd ..
    118128        fi
     129        #}}}
    119130else
    120131
     
    124135
    125136fi
    126 
    127 #Generate Makefiles and compile ISSM if requested
     137#}}}
     138#Compile ISSM if requested              (SKIPCOMPILATION) {{{1
    128139if [ "$SKIPCOMPILATION" != "yes" ]
    129140then
     
    147158        fi
    148159fi
    149 
     160#}}}
     161
     162#Prepare run
     163#Windows hack for startup.m {{{1
    150164#windows environments: ISSM_DIR_WIN variable not correctly picked up when using
    151165#the cron job. just get startup to take the ISSM_DIR variable as the pwd:
     
    155169        mv startup.m.bak startup.m
    156170fi
    157 
     171#}}}
     172#Create NightlyRun directory and nightly.log {{{1
    158173#put installation elapsed time in nightly.log
    159174INSTALL_TIME=$(timer)
     
    170185elapsed_install: $(echo $ELAPSED_INSTALL)
    171186END
    172 
    173 #Launch matlab and the nightly run script
     187#}}}
     188
     189#Run tests
     190#Call run.sh script{{{1
    174191cd $ISSM_DIR/cron/
    175192./run.sh $1
     193#}}}
     194#Complete nightly.log {{{1
    176195ELAPSED_RUN=$(timer $INSTALL_TIME)
    177196ELAPSED_TOTAL=$(timer $START_TIME)
     
    180199elapsed_total: $(echo $ELAPSED_TOTAL)
    181200END
    182 
    183 #Build html report
     201#}}}
     202
     203#Send Report
     204#Build html report {{{1
    184205cd $ISSM_DIR/cron/
    185206./report.sh
    186207echo "html report located in $ISSM_DIR/test/Verification/NightlyRun/report.html"
    187 
    188 #send mail if requested
     208#}}}
     209#send mail if requested                  (SKIPMAIL) {{{1
    189210if [ "$SKIPMAIL" != "yes" ]
    190211then
     
    218239        done
    219240fi
     241#}}}
Note: See TracChangeset for help on using the changeset viewer.