Commit ea0e313f authored by Raphael Defosseux's avatar Raphael Defosseux

CI: issue #410 --> command options are displayed in build HTML report

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 458019d8
...@@ -204,12 +204,13 @@ then ...@@ -204,12 +204,13 @@ then
STATUS=-1 STATUS=-1
fi fi
echo "COMMAND: build_oai -I -w USRP --eNB" > $ARCHIVES_LOC/build_final_status.log
if [ $STATUS -eq 0 ] if [ $STATUS -eq 0 ]
then then
echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log echo "BUILD_OK" >> $ARCHIVES_LOC/build_final_status.log
echo "STATUS seems OK" echo "STATUS seems OK"
else else
echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log echo "BUILD_KO" >> $ARCHIVES_LOC/build_final_status.log
echo "STATUS failed?" echo "STATUS failed?"
fi fi
exit $STATUS exit $STATUS
...@@ -143,13 +143,21 @@ function summary_table_header { ...@@ -143,13 +143,21 @@ function summary_table_header {
echo " <h3>$1</h3>" >> ./build_results.html echo " <h3>$1</h3>" >> ./build_results.html
if [ -f $2/build_final_status.log ] if [ -f $2/build_final_status.log ]
then then
if [ `grep -c COMMAND $2/build_final_status.log` -eq 1 ]
then
COMMAND=`grep COMMAND $2/build_final_status.log | sed -e "s#COMMAND: ##"`
else
COMMAND="Unknown"
fi
if [ `grep -c BUILD_OK $2/build_final_status.log` -eq 1 ] if [ `grep -c BUILD_OK $2/build_final_status.log` -eq 1 ]
then then
echo " <div class=\"alert alert-success\">" >> ./build_results.html echo " <div class=\"alert alert-success\">" >> ./build_results.html
echo " <span class=\"glyphicon glyphicon-expand\"></span> $COMMAND <span class=\"glyphicon glyphicon-arrow-right\"></span> " >> ./build_results.html
echo " <strong>BUILD was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html echo " <strong>BUILD was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html echo " </div>" >> ./build_results.html
else else
echo " <div class=\"alert alert-danger\">" >> ./build_results.html echo " <div class=\"alert alert-danger\">" >> ./build_results.html
echo " <span class=\"glyphicon glyphicon-expand\"></span> $COMMAND <span class=\"glyphicon glyphicon-arrow-right\"></span> " >> ./build_results.html
echo " <strong>BUILD was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html echo " <strong>BUILD was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html echo " </div>" >> ./build_results.html
fi fi
...@@ -220,6 +228,13 @@ function sca_summary_table_header { ...@@ -220,6 +228,13 @@ function sca_summary_table_header {
NB_WARNINGS=`egrep -c "severity=\"warning\"" $1` NB_WARNINGS=`egrep -c "severity=\"warning\"" $1`
ADDED_ERRORS="0" ADDED_ERRORS="0"
ADDED_WARNINGS="0" ADDED_WARNINGS="0"
FINAL_LOG=`echo $1 | sed -e "s#cppcheck\.xml#build_final_status.log#"`
if [ `grep -c COMMAND $FINAL_LOG` -eq 1 ]
then
COMMAND=`grep COMMAND $FINAL_LOG | sed -e "s#COMMAND: ##"`
else
COMMAND="Unknown"
fi
if [ $MR_TRIG -eq 1 ] if [ $MR_TRIG -eq 1 ]
then then
if [ -d ../../cppcheck_archives ] if [ -d ../../cppcheck_archives ]
...@@ -237,12 +252,14 @@ function sca_summary_table_header { ...@@ -237,12 +252,14 @@ function sca_summary_table_header {
if [ $NB_ERRORS -eq 0 ] && [ $NB_WARNINGS -eq 0 ] if [ $NB_ERRORS -eq 0 ] && [ $NB_WARNINGS -eq 0 ]
then then
echo " <div class=\"alert alert-success\">" >> ./build_results.html echo " <div class=\"alert alert-success\">" >> ./build_results.html
echo " <span class=\"glyphicon glyphicon-expand\"></span> $COMMAND <br><br>" >> ./build_results.html
echo " <strong>CPPCHECK found NO error and NO warning <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html echo " <strong>CPPCHECK found NO error and NO warning <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html
echo " </div>" >> ./build_results.html echo " </div>" >> ./build_results.html
else else
if [ $NB_ERRORS -eq 0 ] if [ $NB_ERRORS -eq 0 ]
then then
echo " <div class=\"alert alert-warning\">" >> ./build_results.html echo " <div class=\"alert alert-warning\">" >> ./build_results.html
echo " <span class=\"glyphicon glyphicon-expand\"></span> $COMMAND <br><br>" >> ./build_results.html
if [ $PU_TRIG -eq 1 ] if [ $PU_TRIG -eq 1 ]
then then
echo " <strong>CPPCHECK found NO error and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html echo " <strong>CPPCHECK found NO error and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html
...@@ -259,6 +276,7 @@ function sca_summary_table_header { ...@@ -259,6 +276,7 @@ function sca_summary_table_header {
echo " </div>" >> ./build_results.html echo " </div>" >> ./build_results.html
else else
echo " <div class=\"alert alert-danger\">" >> ./build_results.html echo " <div class=\"alert alert-danger\">" >> ./build_results.html
echo " <span class=\"glyphicon glyphicon-expand\"></span> $COMMAND <br><br>" >> ./build_results.html
if [ $PU_TRIG -eq 1 ] if [ $PU_TRIG -eq 1 ]
then then
echo " <strong>CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html echo " <strong>CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
......
...@@ -185,10 +185,16 @@ function check_on_vm_build { ...@@ -185,10 +185,16 @@ function check_on_vm_build {
fi fi
fi fi
if [[ "$VM_NAME" == *"-cppcheck"* ]]
then
echo "COMMAND: cppcheck $BUILD_OPTIONS . 2> cppcheck.xml" > $ARCHIVES_LOC/build_final_status.log
else
echo "COMMAND: build_oai -I $BUILD_OPTIONS" > $ARCHIVES_LOC/build_final_status.log
fi
if [[ $STATUS -eq 0 ]] if [[ $STATUS -eq 0 ]]
then then
echo "BUILD_OK" > $ARCHIVES_LOC/build_final_status.log echo "BUILD_OK" >> $ARCHIVES_LOC/build_final_status.log
else else
echo "BUILD_KO" > $ARCHIVES_LOC/build_final_status.log echo "BUILD_KO" >> $ARCHIVES_LOC/build_final_status.log
fi fi
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment