Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
shellcheck tools/jenkins scripts.
authorAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 14 Jul 2020 23:10:11 +0000 (01:10 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Tue, 14 Jul 2020 23:10:11 +0000 (01:10 +0200)
Mostly quoting stuff ..

tools/jenkins/Coverage.sh
tools/jenkins/DynamicAnalysis.sh
tools/jenkins/Flags.sh
tools/jenkins/Sanitizers.sh
tools/jenkins/build.sh
tools/jenkins/project_description.sh

index 87639b8..74aba11 100755 (executable)
@@ -14,7 +14,7 @@ die() {
 pkg_check() {
   for pkg
   do
-    if command -v $pkg
+    if command -v "$pkg"
     then
        echo "$pkg is installed. Good."
     else
@@ -27,7 +27,7 @@ pkg_check xsltproc gcovr ant cover2cover.py
 
 ### Cleanup previous runs
 
-! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
+[ -n "$WORKSPACE" ] || die "No WORKSPACE"
 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
 
 do_cleanup() {
@@ -46,7 +46,7 @@ do_cleanup "$BUILDFOLDER"
 NUMPROC="$(nproc)" || NUMPROC=1
 
 
-cd $BUILDFOLDER
+cd "$BUILDFOLDER"
 rm -rf java_cov*
 rm -rf jacoco_cov*
 rm -rf python_cov*
@@ -60,7 +60,7 @@ cmake -Denable_documentation=OFF -Denable_lua=ON \
       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=ON \
       -Denable_smpi_papi=ON \
       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON \
-      -Denable_coverage=ON -DLTO_EXTRA_FLAG="auto" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $WORKSPACE
+      -Denable_coverage=ON -DLTO_EXTRA_FLAG="auto" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON "$WORKSPACE"
 
 #build with sonarqube scanner wrapper
 /home/ci/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-outputs make -j$NUMPROC tests
@@ -79,34 +79,34 @@ if [ -f Testing/TAG ] ; then
   i=0
   for file in $files
   do
-    sourcepath=$( dirname $file )
+    sourcepath=$( dirname "$file" )
     #convert jacoco reports in xml ones
-    ant -f $WORKSPACE/tools/jenkins/jacoco.xml -Dexamplesrcdir=$WORKSPACE -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
+    ant -f "$WORKSPACE"/tools/jenkins/jacoco.xml -Dexamplesrcdir="$WORKSPACE" -Dbuilddir="$BUILDFOLDER"/"${sourcepath}" -Djarfile="$BUILDFOLDER"/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
     #convert jacoco xml reports in cobertura xml reports
-    cover2cover.py $BUILDFOLDER/${sourcepath}/report.xml .. ../src/bindings/java src/bindings/java > $BUILDFOLDER/java_coverage_${i}.xml
+    cover2cover.py "$BUILDFOLDER"/"${sourcepath}"/report.xml .. ../src/bindings/java src/bindings/java > "$BUILDFOLDER"/java_coverage_${i}.xml
     #save jacoco xml report as sonar only allows it 
-    mv $BUILDFOLDER/${sourcepath}/report.xml $BUILDFOLDER/jacoco_cov_${i}.xml
+    mv "$BUILDFOLDER"/"${sourcepath}"/report.xml "$BUILDFOLDER"/jacoco_cov_${i}.xml
     i=$((i + 1))
   done
 
   #convert python coverage reports in xml ones
-  cd $BUILDFOLDER
+  cd "$BUILDFOLDER"
   find .. -size +1c -name ".coverage*" -exec mv {} . \;
   /usr/bin/python3-coverage combine
   /usr/bin/python3-coverage xml -i -o ./python_coverage.xml
 
-  cd $WORKSPACE
+  cd "$WORKSPACE"
   #convert all gcov reports to xml cobertura reports
-  gcovr -r . --xml-pretty -e teshsuite -u -o $BUILDFOLDER/xml_coverage.xml
-  xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl build/Testing/$( head -n 1 < build/Testing/TAG )/Test.xml > CTestResults_memcheck.xml
+  gcovr -r . --xml-pretty -e teshsuite -u -o "$BUILDFOLDER"/xml_coverage.xml
+  xsltproc "$WORKSPACE"/tools/jenkins/ctest2junit.xsl build/Testing/"$( head -n 1 < build/Testing/TAG )"/Test.xml > CTestResults_memcheck.xml
 
   #generate sloccount report
-  sloccount --duplicates --wide --details $WORKSPACE | grep -v -e '.git' -e 'mpich3-test' -e 'sloccount.sc' -e 'isp/umpire' -e 'build/' -e 'xml_coverage.xml' -e 'CTestResults_memcheck.xml' -e 'DynamicAnalysis.xml' > $WORKSPACE/sloccount.sc
+  sloccount --duplicates --wide --details "$WORKSPACE" | grep -v -e '.git' -e 'mpich3-test' -e 'sloccount.sc' -e 'isp/umpire' -e 'build/' -e 'xml_coverage.xml' -e 'CTestResults_memcheck.xml' -e 'DynamicAnalysis.xml' > "$WORKSPACE"/sloccount.sc
 
   #generate PVS-studio report
   EXCLUDEDPATH="-e $WORKSPACE/src/include/catch.hpp -e $WORKSPACE/teshsuite/smpi/mpich3-test/ -e $WORKSPACE/teshsuite/smpi/isp/ -e *_dtd.c -e *_dtd.h -e *yy.c -e  $WORKSPACE/src/xbt/automaton/ -e $WORKSPACE/src/smpi/colls/ -e $WORKSPACE/examples/smpi/NAS/ -e $WORKSPACE/examples/smpi/gemm/gemm.c -e $WORKSPACE/src/msg/ -e $WORKSPACE/include/msg/ -e $WORKSPACE/examples/deprecated/ -e $WORKSPACE/teshsuite/msg/"
-  pvs-studio-analyzer analyze -f $BUILDFOLDER/compile_commands.json -o $WORKSPACE/pvs.log $EXCLUDEDPATH -j$NUMPROC
+  pvs-studio-analyzer analyze -f "$BUILDFOLDER"/compile_commands.json -o "$WORKSPACE"/pvs.log "$EXCLUDEDPATH" -j$NUMPROC
   #disable V1042 (copyleft), V521 (commas in catch.hpp)
-  plog-converter -t xml -o $WORKSPACE/pvs.plog -d V1042,V521 $WORKSPACE/pvs.log
+  plog-converter -t xml -o "$WORKSPACE"/pvs.plog -d V1042,V521 "$WORKSPACE"/pvs.log
 
 fi || exit 42
index e0a87b8..f3e2930 100755 (executable)
@@ -12,7 +12,7 @@ die() {
 pkg_check() {
   for pkg
   do
-    if command -v $pkg
+    if command -v "$pkg"
     then
        echo "$pkg is installed. Good."
     else
@@ -25,7 +25,7 @@ pkg_check valgrind pcregrep
 
 ### Cleanup previous runs
 
-! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
+[ -n "$WORKSPACE" ] || die "No WORKSPACE"
 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
 
 do_cleanup() {
@@ -37,14 +37,14 @@ do_cleanup() {
     fi
     mkdir "$d" || die "Could not create $d"
   done
-  find $WORKSPACE -name "memcheck_test_*.memcheck" -exec rm {} \;
+  find "$WORKSPACE" -name "memcheck_test_*.memcheck" -exec rm {} \;
 }
 
 do_cleanup "$WORKSPACE/build" "$WORKSPACE/memcheck"
 
 NUMPROC="$(nproc)" || NUMPROC=1
 
-cd $WORKSPACE/build
+cd "$WORKSPACE"/build
 
 ### Proceed with the tests
 ctest -D ExperimentalStart || true
@@ -53,17 +53,16 @@ cmake -Denable_documentation=OFF -Denable_lua=OFF -Denable_python=OFF \
       -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
       -Denable_jedule=OFF -Denable_mallocators=OFF \
       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_model-checking=OFF \
-      -Denable_memcheck_xml=ON -DLTO_EXTRA_FLAG="auto" $WORKSPACE
+      -Denable_memcheck_xml=ON -DLTO_EXTRA_FLAG="auto" "$WORKSPACE"
 
 
 make -j$NUMPROC tests
 ctest --no-compress-output -D ExperimentalTest -j$NUMPROC || true
 
-cd $WORKSPACE/build
+cd "$WORKSPACE"/build
 if [ -f Testing/TAG ] ; then
-   find $WORKSPACE -iname "*.memcheck" -exec mv {} $WORKSPACE/memcheck \;
+   find "$WORKSPACE" -iname "*.memcheck" -exec mv {} "$WORKSPACE"/memcheck \;
    #remove all "empty" files
-   grep -r -L "error>" $WORKSPACE/memcheck | xargs rm -f
-   mv Testing/$(head -n 1 < Testing/TAG)/Test.xml  $WORKSPACE/DynamicAnalysis.xml
+   grep -r -L "error>" "$WORKSPACE"/memcheck | xargs rm -f
+   mv Testing/"$(head -n 1 < Testing/TAG)"/Test.xml  "$WORKSPACE"/DynamicAnalysis.xml
 fi
-
index a76c411..cbc23d4 100755 (executable)
@@ -22,7 +22,7 @@ onoff() {
 
 ### Cleanup previous runs
 
-! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
+[ -n "$WORKSPACE" ] || die "No WORKSPACE"
 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
 
 do_cleanup() {
@@ -40,39 +40,39 @@ do_cleanup "$WORKSPACE/build"
 
 NUMPROC="$(nproc)" || NUMPROC=1
 
-cd $WORKSPACE/build
+cd "$WORKSPACE"/build
 
 #we can't just receive ON or OFF as values as display is bad in the resulting jenkins matrix
 
-if [ $1 = "JAVA" ]
+if [ "$1" = "JAVA" ]
 then
   buildjava="ON"
 else
   buildjava="OFF"
 fi
 
-if [ $2 = "MC" ]
+if [ "$2" = "MC" ]
 then
   buildmc="ON"
 else
   buildmc="OFF"
 fi
 
-if [ $3 = "SMPI" ]
+if [ "$3" = "SMPI" ]
 then
   buildsmpi="ON"
 else
   buildsmpi="OFF"
 fi
 
-if [ $4 = "DEBUG" ]
+if [ "$4" = "DEBUG" ]
 then
   builddebug="ON"
 else
   builddebug="OFF"
 fi
 
-if [ $5 = "MSG" ]
+if [ "$5" = "MSG" ]
 then
   buildmsg="ON"
 else
@@ -91,9 +91,7 @@ cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} -Den
       -Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \
       -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \
       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=OFF \
-      -Denable_ns3=$(onoff test "$buildmc" != "ON") -Denable_coverage=OFF -DLTO_EXTRA_FLAG="auto" $WORKSPACE
+      -Denable_ns3=$(onoff test "$buildmc" != "ON") -Denable_coverage=OFF -DLTO_EXTRA_FLAG="auto" "$WORKSPACE"
 
 make -j$NUMPROC tests
 make clean
-
-
index 834a295..87d5aba 100755 (executable)
@@ -39,7 +39,7 @@ fi
 pkg_check() {
   for pkg
   do
-    if command -v $pkg
+    if command -v "$pkg"
     then
        echo "$pkg is installed. Good."
     else
@@ -52,7 +52,7 @@ pkg_check xsltproc
 
 ### Cleanup previous runs
 
-! [ -z "$WORKSPACE" ] || die "No WORKSPACE"
+[ -n "$WORKSPACE" ] || die "No WORKSPACE"
 [ -d "$WORKSPACE" ] || die "WORKSPACE ($WORKSPACE) does not exist"
 
 do_cleanup() {
@@ -70,7 +70,7 @@ do_cleanup "$WORKSPACE/build"
 
 NUMPROC="$(nproc)" || NUMPROC=1
 
-cd $WORKSPACE/build
+cd "$WORKSPACE"/build
 
 ctest -D ExperimentalStart || true
 
@@ -79,14 +79,14 @@ cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=OFF \
       -Denable_jedule=ON -Denable_mallocators=OFF \
       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=OFF \
       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_ISP_testsuite=ON -Denable_coverage=OFF\
-      -Denable_fortran=OFF -Denable_python=OFF -DLTO_EXTRA_FLAG="auto" ${SANITIZER_OPTIONS} $WORKSPACE
+      -Denable_fortran=OFF -Denable_python=OFF -DLTO_EXTRA_FLAG="auto" "${SANITIZER_OPTIONS}" "$WORKSPACE"
 
 make -j$NUMPROC tests
 ctest --no-compress-output -D ExperimentalTest || true
 
 if [ -f Testing/TAG ] ; then
-   xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl Testing/$(head -n 1 < Testing/TAG)/Test.xml > CTestResults_${SANITIZER}.xml
-   mv CTestResults_${SANITIZER}.xml $WORKSPACE
+   xsltproc "$WORKSPACE"/tools/jenkins/ctest2junit.xsl Testing/"$(head -n 1 < Testing/TAG)"/Test.xml > CTestResults_"${SANITIZER}".xml
+   mv CTestResults_"${SANITIZER}".xml "$WORKSPACE"
 fi
 
 make clean
index 12d967e..2045041 100755 (executable)
@@ -31,7 +31,7 @@ die () {
   shift
   [ $# -gt 0 ] || set -- "Error - Halting"
   echo "$@" >&2
-  exit $status
+  exit "$status"
 }
 
 # Get an ON/OFF string from a command:
@@ -134,13 +134,13 @@ ulimit -c 0 || true
 echo "XX"
 echo "XX Get out of the tree"
 echo "XX"
-if [ -d $WORKSPACE/build ]
+if [ -d "$WORKSPACE"/build ]
 then
   # Windows cannot remove the directory if it's still used by the previous build
-  rm -rf $WORKSPACE/build || sleep 10 && rm -rf $WORKSPACE/build || sleep 10 && rm -rf $WORKSPACE/build
+  rm -rf "$WORKSPACE"/build || sleep 10 && rm -rf "$WORKSPACE"/build || sleep 10 && rm -rf "$WORKSPACE"/build
 fi
-mkdir $WORKSPACE/build
-cd $WORKSPACE/build
+mkdir "$WORKSPACE"/build
+cd "$WORKSPACE"/build
 
 have_NS3="no"
 if dpkg -l libns3-dev 2>&1|grep -q "ii  libns3-dev" ; then
@@ -153,25 +153,25 @@ PATH="$WORKSPACE/build/lib:$PATH"
 
 echo "XX"
 echo "XX Build the archive out of the tree"
-echo "XX   pwd: "$(pwd)
+echo "XX   pwd: $(pwd)"
 echo "XX"
 
-cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
+cmake -G"$GENERATOR" -Denable_documentation=OFF "$WORKSPACE"
 make dist -j $NUMBER_OF_PROCESSORS
 SIMGRID_VERSION=$(cat VERSION)
 
 echo "XX"
 echo "XX Open the resulting archive"
 echo "XX"
-gunzip ${SIMGRID_VERSION}.tar.gz
-tar xf ${SIMGRID_VERSION}.tar
-mkdir ${WORKSPACE}/build/${SIMGRID_VERSION}/build
-cd ${WORKSPACE}/build/${SIMGRID_VERSION}/build
+gunzip "${SIMGRID_VERSION}".tar.gz
+tar xf "${SIMGRID_VERSION}".tar
+mkdir "${WORKSPACE}"/build/"${SIMGRID_VERSION}"/build
+cd "${WORKSPACE}"/build/"${SIMGRID_VERSION}"/build
 SRCFOLDER="${WORKSPACE}/build/${SIMGRID_VERSION}"
 
 echo "XX"
 echo "XX Configure and build SimGrid"
-echo "XX   pwd: "$(pwd)
+echo "XX   pwd: $(pwd)"
 echo "XX"
 set -x
 
@@ -197,7 +197,7 @@ cmake -G"$GENERATOR" ${INSTALL:+-DCMAKE_INSTALL_PREFIX=$INSTALL} \
   -Denable_java=$(onoff test "$build_mode" = "ModelChecker") \
   -Denable_msg=$(onoff test "$build_mode" = "ModelChecker") \
   -DLTO_EXTRA_FLAG="auto" \
-  $SRCFOLDER
+  "$SRCFOLDER"
 #  -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
 set +x
 
@@ -210,7 +210,7 @@ echo "XX"
 
 ctest -T test --output-on-failure --no-compress-output || true
 
-if test -n "$INSTALL" && [ ${branch_name} = "origin/master" ] ; then
+if test -n "$INSTALL" && [ "${branch_name}" = "origin/master" ] ; then
   echo "XX"
   echo "XX Test done. Install everything since it's a regular build, not on a Windows."
   echo "XX"
index 49ddd11..90880da 100755 (executable)
@@ -6,7 +6,7 @@ get_boost(){
     then
       BOOST=$(grep -m 1 "Found Boost:" ./consoleText | sed  "s/.*-- Found Boost:.*found suitable version \"\([a-zA-Z0-9\.]*\)\",.*/\1/g")
     fi
-  echo $BOOST
+  echo "$BOOST"
 }
 
 get_compiler(){
@@ -23,7 +23,7 @@ get_cmake(){
 
 get_ns3(){
   found=$(grep -c "ns-3 found" ./consoleText)
-  if [ $found != 0 ]; then
+  if [ "$found" != 0 ]; then
     echo "✔"
   else
     echo ""
@@ -32,7 +32,7 @@ get_ns3(){
 
 get_python(){
   found=$(grep -c "Compile Python bindings .....: ON" ./consoleText)
-  if [ $found != 0 ]; then
+  if [ "$found" != 0 ]; then
     grep -m 1 "Found PythonInterp" ./consoleText| sed "s/.*-- Found PythonInterp.*found suitable version \"\([a-zA-Z0-9\.]*\)\",.*/\1/g"
   else
     echo ""
@@ -44,7 +44,7 @@ if [ -f consoleText ]; then
 fi
 
 
-if [ -z $BUILD_URL ]; then
+if [ -z "$BUILD_URL" ]; then
   BUILD_URL="https://ci.inria.fr/simgrid/job/SimGrid/lastBuild"
 fi
 
@@ -66,7 +66,7 @@ function compareVersion(v1, v2) {
         v1[i] = parseInt(v1[i], 10);
         v2[i] = parseInt(v2[i], 10);
         if (v1[i] > v2[i]) return 1;
-        if (v1[i] < v2[i]) return -1;        
+        if (v1[i] < v2[i]) return -1;
     }
     return v1.length == v2.length ? 0: (v1.length < v2.length ? -1 : 1);
 }</script>
@@ -148,44 +148,44 @@ do
     color1=""
     color2=""
     #in case of success, replace blue by green in status balls
-    wget --quiet https://ci.inria.fr/simgrid/buildStatus/text?job=SimGrid%2Fbuild_mode%3DDebug%2Cnode%3D${node} -O status  >/dev/null 2>&1
+    wget --quiet https://ci.inria.fr/simgrid/buildStatus/text?job=SimGrid%2Fbuild_mode%3DDebug%2Cnode%3D"${node}" -O status  >/dev/null 2>&1
     status=$(cat status)
-    if [ $status == "Success" ]; then
+    if [ "$status" == "Success" ]; then
       color1="&color=green"
     fi
     rm status
     statusmc="<img src=https://ci.inria.fr/simgrid/images/24x24/grey.png>"
-    wget --quiet https://ci.inria.fr/simgrid/buildStatus/text?job=SimGrid%2Fbuild_mode%3DModelChecker%2Cnode%3D${node} -O status >/dev/null 2>&1
+    wget --quiet https://ci.inria.fr/simgrid/buildStatus/text?job=SimGrid%2Fbuild_mode%3DModelChecker%2Cnode%3D"${node}" -O status >/dev/null 2>&1
     status=$(cat status)
-    if [ $status ]; then 
-      if [ $status == "Success" ]; then
+    if [ "$status" ]; then
+      if [ "$status" == "Success" ]; then
         color2="&color=green"
       fi
       statusmc="<a href=\"build_mode=ModelChecker,node=${node}/\"><img src=\"https://ci.inria.fr/simgrid/job/SimGrid/build_mode=ModelChecker,node=${node}/badge/icon?style=ball-24x24${color2}\"/>"
     fi
     rm status
-    echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td><td class="matrix-cell" style="text-align:center"><a href="build_mode=Debug,node=${node}/"><img src="https://ci.inria.fr/simgrid/job/SimGrid/build_mode=Debug,node=${node}/badge/icon?style=ball-24x24${color1}"/></td><td class="matrix-cell" style="text-align:center">${statusmc}</td></tr>"
+    echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td><td class=\"matrix-cell\" style=\"text-align:center\"><a href=\"build_mode=Debug,node=${node}/\"><img src=\"https://ci.inria.fr/simgrid/job/SimGrid/build_mode=Debug,node=${node}/badge/icon?style=ball-24x24${color1}\"/></td><td class=\"matrix-cell\" style=\"text-align:center\">${statusmc}</td></tr>"
     rm consoleText
 done
 
 
 #Travis - get ID of the last jobs with the API
 BUILD_NUM=$(curl -s 'https://api.travis-ci.org/repos/simgrid/simgrid/builds?limit=1' | grep -o '^\[{"id":[0-9]*,' | grep -o '[0-9]' | tr -d '\n')
-BUILDS=($(curl -s https://api.travis-ci.org/repos/simgrid/simgrid/builds/${BUILD_NUM} | grep -o '{"id":[0-9]*,' | grep -o '[0-9]*'| tail -n 3))
-OS=($(curl -s https://api.travis-ci.org/repos/simgrid/simgrid/builds/${BUILD_NUM} | grep -o '"os":"[a-z]*",' | sed  's/"os":"\([a-z]*\)",/\1/g'| tail -n 3))
+BUILDS=($(curl -s https://api.travis-ci.org/repos/simgrid/simgrid/builds/"${BUILD_NUM}" | grep -o '{"id":[0-9]*,' | grep -o '[0-9]*'| tail -n 3))
+OS=($(curl -s https://api.travis-ci.org/repos/simgrid/simgrid/builds/"${BUILD_NUM}" | grep -o '"os":"[a-z]*",' | sed  's/"os":"\([a-z]*\)",/\1/g'| tail -n 3))
 
 for id in "${!BUILDS[@]}"
 do
-    wget --quiet https://api.travis-ci.org/v3/job/${BUILDS[$id]}/log.txt -O ./consoleText >/dev/null 2>&1
+    wget --quiet https://api.travis-ci.org/v3/job/"${BUILDS[$id]}"/log.txt -O ./consoleText >/dev/null 2>&1
     sed -i -e "s/\r//g" ./consoleText
 
-    if [ ${OS[$id]} == "linux" ]; then
+    if [ "${OS[$id]}" == "linux" ]; then
       node="travis-linux (<a href=\"https://travis-ci.org/simgrid/simgrid/jobs/${BUILDS[$id]}\">log</a>)"
       os="Ubuntu  <a href=\"https://docs.travis-ci.com/user/reference/bionic/\">18.04 bionic</a>"
-    elif [ ${OS[$id]} == "osx" ]; then
+    elif [ "${OS[$id]}" == "osx" ]; then
       node="travis-mac (<a href=\"https://travis-ci.org/simgrid/simgrid/jobs/${BUILDS[$id]}\">log</a>)"
       os="Mac OS X <a href=\"https://docs.travis-ci.com/user/reference/osx/\">Catalina (10.15)</a> "
-    elif [ ${OS[$id]} == "windows" ]; then
+    elif [ "${OS[$id]}" == "windows" ]; then
       node="travis-windows (<a href=\"https://travis-ci.org/simgrid/simgrid/jobs/${BUILDS[$id]}\">log</a>)"
       os="Windows <a href=\"https://docs.travis-ci.com/user/reference/windows/\">Server 1809</a>"
     fi
@@ -206,9 +206,9 @@ done
 
 #Appveyor - get ID of the last job with the API
 BUILD_ID=$(curl -s "https://ci.appveyor.com/api/projects/mquinson/simgrid" | grep -o '\[{"jobId":"[a-zA-Z0-9]*",' | sed "s/\[{\"jobId\":\"//" | sed "s/\",//")
-wget --quiet https://ci.appveyor.com/api/buildjobs/$BUILD_ID/log -O ./consoleText >/dev/null 2>&1
+wget --quiet https://ci.appveyor.com/api/buildjobs/"$BUILD_ID"/log -O ./consoleText >/dev/null 2>&1
 sed -i -e "s/\r//g" ./consoleText
-node="<a href="https://ci.appveyor.com/project/mquinson/simgrid">appveyor</a>"
+node="<a href=\"https://ci.appveyor.com/project/mquinson/simgrid\">appveyor</a>"
 os="Windows Server 2012 - VS2015 + mingw64 5.3.0"
 boost=$(get_boost)
 compiler=$(get_compiler)