Changeset 1605
- Timestamp:
- 08/06/09 11:41:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/cron/report.sh
r1588 r1605 7 7 cat nightly.log | grep 'package: cielo_serial' | grep -v "not supported yet" > cielo_serial.log 8 8 cat nightly.log | grep 'package: cielo_parallel'| grep -v "not supported yet" > cielo_parallel.log 9 cat nightly.log | grep NIGHTLYRUNTERMINATEDCORRECTLY> check.log10 cat nightly.log | grep ERROR | grep -v "PETSC ERROR"> errors.log11 cat nightly.log | grep SUCCESS> success.log12 cat errors.log success.log > tests.log9 cat nightly.log | grep 'NIGHTLYRUNTERMINATEDCORRECTLY' > check.log 10 cat nightly.log | grep 'ERROR' | grep -v "PETSC ERROR" > errors.log 11 cat nightly.log | grep 'SUCCESS' > success.log 12 cat errors.log success.log > tests.log 13 13 14 14 #create some variables … … 26 26 fi 27 27 28 #style 29 H1_STYLE='width="800px" cellpadding="20"' 30 H1_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-weight: bold; font-size:35px;" align="center"' 31 32 H2_STYLE='width="840px" cellpadding="20"' 33 H2_FONT='style="color:#6495ed; font-family:Arial, Verdana, Tahoma; font-size:28px; font-weight: bold;" align="left"' 34 35 TABLE_STYLE='width="820px" rules=none bgcolor="#ffffdd" border=1 bordercolor="#000000" cellpadding="3"' 36 TABLE_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14; font-weight: normal;" align="left"' 37 38 BODY_STYLE='width="820px"' 39 BODY_FONT="style=\"color:#404040; font-family:Arial, Verdana, Tahoma; font-size:14px;\"" 40 41 NOTEST_STYLE='width="650px"' 42 NOTEST_FONT='style="color:#FF0000; font-family:Arial, Verdana, Tahoma; font-size:14px;" align="left"' 43 44 FOOTER_STYLE='width="800px" cellpadding="10"' 45 FOOTER_FONT='style="color:#404040; font-family:Arial, Verdana, Tahoma; font-size:12px; font-weight: normal;" align="center"' 46 28 47 #build report.html 29 48 30 #first: header 31 cat << END > header.html 32 <style type="text/css"> 33 <!-- 34 .issmbody { 35 margin: auto; 36 width:800px; 37 background: none; 38 color: #404040; 39 font-family: Arial, Verdana, Tahoma; 40 font-size: 14px; 41 font-weight: normal; 42 text-align: left; 43 } 49 #first: summary 50 cat << END > summary.html 51 <div align="center"> 52 <table $H1_STYLE><tr><td $H1_FONT>ISSM Nightly run report</td></tr></table> 44 53 45 .issmh1 { 46 margin:2em auto; 47 width:800px; 48 background: none; 49 color: #6495ed; 50 font-family: Arial, Verdana, Tahoma; 51 font-size: 35px; 52 font-weight: bold; 53 text-align: center; 54 } 55 56 .issmh2 { 57 margin:1.5em auto 1em auto; 58 width:800px; 59 background: transparent; 60 color: #6495ed; 61 font-family: Arial, Verdana, Tahoma; 62 font-weight: bold; 63 font-size: 28px; 64 text-align: left; 65 } 66 67 .issmfooter { 68 margin:auto; 69 width:800px; 70 background: none; 71 color: #404040; 72 font-family: Arial, Verdana, Tahoma; 73 font-size: 12px; 74 font-weight: normal; 75 text-align: center; 76 } 77 78 .issmcomment { 79 padding:4px; 80 margin:0 auto; 81 width:800px; 82 border:1px dashed #000000; 83 text-align: left; 84 font-family: Arial, Verdana, Tahoma; 85 font-size: 14px; 86 color: #404040; 87 background-color:#ffffdd} 88 --> 89 </style> 90 <div class="issmh1">ISSM Nightly run report</div> 91 <br> 92 END 93 94 #then: summary 95 cat << END > summary.html 96 <div class="issmcomment"> 97 date: $TODAY<br> 98 host: $HOST_NAME<br> 99 OS: $OS<br> 100 release: $ISSM_RELEASE<br> 101 total elapsed time: $ELAPSED_TOTAL<br> 102 installation elapsed time: $ELAPSED_INSTAL<br> 103 runs elapsed time: $ELAPSED_RUN<br> 104 <br> 105 status: $(if [ $(echo $IS_INSTALL) = 0 ]; 54 <table $TABLE_STYLE> 55 <tr> 56 <td $TABLE_FONT>host: $HOST_NAME</td> 57 <td $TABLE_FONT>date: $TODAY</td> 58 </tr> 59 <tr> 60 <td $TABLE_FONT>OS: $OS</td> 61 <td $TABLE_FONT>total elapsed time: $ELAPSED_TOTAL</td> 62 </tr> 63 <tr> 64 <td $TABLE_FONT>release: $ISSM_RELEASE</td> 65 <td $TABLE_FONT>installation elapsed time: $ELAPSED_INSTAL</td> 66 </tr> 67 <tr> 68 $(#print status 69 if [ $(echo $IS_INSTALL) = 0 ]; 106 70 then 107 71 #installation failed, end of report 108 echo "<span style=\"color:#FF0000\">installation failed</span></div>" 72 echo "<td $TABLE_FONT>status: <span style=\"color:#FF0000\">installation failed</span></td>" 73 echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>" 74 echo "</tr>" 75 echo "</table>" 109 76 rm check.log errors.log success.log tests.log 110 77 else 78 #installation successful. Did we go to the end? 79 111 80 if [ $(echo $IS_END) = 0 ]; 112 81 then 113 echo "< span style=\"color:#FF0000\">stopped before the end</span>"82 echo "<td $TABLE_FONT>status: <span style=\"color:#FFA500\">stopped before the end</span></td>" 114 83 else 115 echo " all test desks have been run"84 echo "<td $TABLE_FONT>status: <span style=\"color:#008000\">all test desks have been run</span></td>" 116 85 fi 117 echo "<br>" 118 echo "number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}'; rm errors.log)<br>" 119 echo "number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}';rm success.log tests.log)</div>" 120 echo "<br>" 121 echo "<hr width=\"900px\">" 86 echo "<td $TABLE_FONT>execution elapsed time: $ELAPSED_RUN</td>" 87 echo "</tr>" 88 echo "<tr>" 89 echo "<td $TABLE_FONT>number of errors: $(wc -l errors.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}'; rm errors.log)</td>" 90 echo "<td $TABLE_FONT> </td>" 91 echo "</tr>" 92 echo "<tr>" 93 echo "<td $TABLE_FONT>number of success: $(wc -l success.log | awk '{printf("%s",$1);}')/$(wc -l tests.log | awk '{printf("%s",$1);}'; rm success.log tests.log)</td>" 94 echo "<td $TABLE_FONT> </td>" 95 echo "</tr>" 96 echo "</table>" 97 98 #draw a line and clean up 99 echo "<br><hr width=\"900px\">" 122 100 rm check.log 123 101 fi) 124 102 END 103 125 104 126 105 #report content … … 131 110 132 111 #enter title 133 if [ $package == "macayeal" ]; then 134 echo "<div class=\"issmh2\">MacAyeal package</div>" 112 if [ $package == "macayeal" ]; 113 then 114 echo "<table $H2_STYLE><tr><td $H2_FONT>Macayeal package</td></tr></table>" 135 115 fi 136 if [ $package == "ice" ]; then 137 echo "<div class=\"issmh2\">Ice package</div>" 116 if [ $package == "ice" ]; 117 then 118 echo "<table $H2_STYLE><tr><td $H2_FONT>Ice package</td></tr></table>" 138 119 fi 139 if [ $package == "cielo_serial" ]; then 140 echo "<div class=\"issmh2\">Cielo Serial package</div>" 120 if [ $package == "cielo_serial" ]; 121 then 122 echo "<table $H2_STYLE><tr><td $H2_FONT>Cielo serial package</td></tr></table>" 141 123 fi 142 if [ $package == "cielo_parallel" ]; then 143 echo "<div class=\"issmh2\">Cielo Parallel package</div>" 124 if [ $package == "cielo_parallel" ]; 125 then 126 echo "<table $H2_STYLE><tr><td $H2_FONT>Cielo parallel package</td></tr></table>" 144 127 fi 145 146 #Print division147 echo "<div class=\"issmbody\">"148 128 149 129 #check that at least one Test exists … … 151 131 152 132 #No Test: use a table to fix entourage bug. 153 echo "<table width=\"20%\" style=\"color:#FF0000; font-size:14px;\"><tr><td align=\"center\">No test found.</td></tr></table>"133 echo "<table $NOTEST_STYLE><tr><td $NOTEST_FONT>No test found.</td></tr></table>" 154 134 155 135 else 156 136 157 echo "<table cellspacing=\"-1\" width=\"100%\" style=\"font-family: Arial, Verdana, Tahoma; color: #404040;\">"158 echo "<tr> <th style=\"font-size:14px;\">Result</th> <th style=\"font-size:14px;\">Tolerance</th> <th style=\"font-size:14px;\">Test</th> <th style=\"font-size:14px;\">Solution</th> <th style=\"font-size:14px;\">Field</th> </tr>"137 echo "<table $BODY_STYLE cellspacing=\"-1\">" 138 echo "<tr> <th $BODY_FONT>Result</th> <th $BODY_FONT>Tolerance</th> <th $BODY_FONT>Test</th> <th $BODY_FONT>Solution</th> <th $BODY_FONT>Field</th> </tr>" 159 139 160 140 # go through the lines of $package.log … … 173 153 color="bgcolor=#ffdddd"; 174 154 fi 155 FONT=$(echo "$BODY_FONT $color") 175 156 176 157 #build html corresponding line 177 cat $package.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk '/line'$COUNTER'o/ {printf("<td '$color' style=\"font-size:14px;\">%s</td><td '$color' style=\"font-size:14px;\"> %s%s%s</td><td '$color' style=\"font-size:14px;\"> %s</td><td '$color' style=\"font-size:14px;\"> %s</td><td '$color' style=\"font-size:14px;\"> %s</td>",$2,$4,$5,$6,$8,$10,$14);}'; 158 cat $package.log | awk '{ printf "line%so %s\n", NR, $0 }' | awk -v FONT="$FONT" ' 159 /line'$COUNTER'o/ { printf("<td %s>%s</td><td %s> %s%s%s</td><td %s> %s</td><td %s> %s</td><td %s> %s</td>",FONT,$2,FONT,$4,$5,$6,FONT,$8,FONT,$10,FONT,$14);} 160 '; 178 161 echo "</tr>" 179 162 done … … 182 165 fi 183 166 184 #Print end division and remove log file 185 echo "</div>" 167 #remove log file 186 168 rm $package.log 187 169 … … 198 180 cat << END > footer.html 199 181 <br> 200 <div class="issmfooter"><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</div> 182 <table $FOOTER_STYLE><tr><td $FOOTER_FONT><a href="http://issm.jpl.nasa.gov" title="ISSM website" target="_blank">ISSM</a> nightly run report</td></tr></table> 183 </div> 201 184 END 202 185 … … 204 187 if [ $(echo $IS_INSTALL) = 1 ]; 205 188 then 206 cat header.htmlsummary.html content.html footer.html > report.html207 rm header.htmlsummary.html content.html footer.html189 cat summary.html content.html footer.html > report.html 190 rm summary.html content.html footer.html 208 191 else 209 cat header.htmlsummary.html footer.html > report.html210 rm header.htmlsummary.html footer.html192 cat summary.html footer.html > report.html 193 rm summary.html footer.html 211 194 fi
Note:
See TracChangeset
for help on using the changeset viewer.