Changeset 4819
- Timestamp:
- 07/27/10 07:49:31 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/cron/nightlyrun.sh
r4729 r4819 4 4 5 5 #some functions 6 function timer() 6 function timer() #{{{1 7 7 { 8 8 if [[ $# -eq 0 ]]; then … … 20 20 printf '%d:%02d:%02d' $dh $dm $ds 21 21 fi 22 } 23 function todaydate() 22 } #}}} 23 function todaydate() #{{{1 24 24 { 25 25 suffix=`date | awk '{printf("%s-%s-%s %s",$2,$3,$6,$4);}'` 26 26 echo $suffix; 27 } 28 function host_name() 27 } #}}} 28 function host_name() #{{{1 29 29 { 30 30 #return host name depending on the OS … … 36 36 fi 37 37 echo $HOST_NAME; 38 } 39 40 #get configs 38 } #}}} 39 40 #Get configuration 41 #Source config file{{{1 41 42 if [ $# -ne 1 ]; 42 43 then 43 44 #no config file specified: exit 44 echo "no config file specified. Exiting..." 45 echo "no config file specified. Exiting..." >&2 # Error message to stderr. 45 46 exit 1 46 47 fi 48 if [ ! -f "$1" ] 49 then 50 echo "File $1 not found!" >&2 # Error message to stderr. 51 exit 1 52 fi 47 53 source $1; 54 #}}} 55 #Export ISSM_* variables{{{1 48 56 export ISSM_DIR 49 57 export ISSM_ARCH 50 51 # launch nightly run (get start time)58 #}}} 59 #Initialize variables {{{1 52 60 TODAY=$(todaydate); 53 61 HOST_NAME=$(host_name $OS); … … 56 64 USER=$(whoami); 57 65 INIT_PATH=$(pwd); 58 59 #Checkout and install ISSM if required 66 #}}} 67 68 #Lauch installation 69 #Checkout and install ISSM if requested (SKIPINSTALLATION){{{1 60 70 if [ "$SKIPINSTALLATION" != "yes" ] 61 71 then … … 81 91 END 82 92 83 # Install external packages93 #Compile external packages if requested (SKIPPACKAGESCOMPILATION){{{2 84 94 if [ "$SKIPPACKAGESCOMPILATION" = "yes" ] 85 95 then … … 117 127 cd .. 118 128 fi 129 #}}} 119 130 else 120 131 … … 124 135 125 136 fi 126 127 # Generate Makefiles and compile ISSM if requested137 #}}} 138 #Compile ISSM if requested (SKIPCOMPILATION) {{{1 128 139 if [ "$SKIPCOMPILATION" != "yes" ] 129 140 then … … 147 158 fi 148 159 fi 149 160 #}}} 161 162 #Prepare run 163 #Windows hack for startup.m {{{1 150 164 #windows environments: ISSM_DIR_WIN variable not correctly picked up when using 151 165 #the cron job. just get startup to take the ISSM_DIR variable as the pwd: … … 155 169 mv startup.m.bak startup.m 156 170 fi 157 171 #}}} 172 #Create NightlyRun directory and nightly.log {{{1 158 173 #put installation elapsed time in nightly.log 159 174 INSTALL_TIME=$(timer) … … 170 185 elapsed_install: $(echo $ELAPSED_INSTALL) 171 186 END 172 173 #Launch matlab and the nightly run script 187 #}}} 188 189 #Run tests 190 #Call run.sh script{{{1 174 191 cd $ISSM_DIR/cron/ 175 192 ./run.sh $1 193 #}}} 194 #Complete nightly.log {{{1 176 195 ELAPSED_RUN=$(timer $INSTALL_TIME) 177 196 ELAPSED_TOTAL=$(timer $START_TIME) … … 180 199 elapsed_total: $(echo $ELAPSED_TOTAL) 181 200 END 182 183 #Build html report 201 #}}} 202 203 #Send Report 204 #Build html report {{{1 184 205 cd $ISSM_DIR/cron/ 185 206 ./report.sh 186 207 echo "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 189 210 if [ "$SKIPMAIL" != "yes" ] 190 211 then … … 218 239 done 219 240 fi 241 #}}}
Note:
See TracChangeset
for help on using the changeset viewer.