Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
provide a backtrace implementation that uses boost.stacktrace
[simgrid.git] / tools / jenkins / project_description.sh
1 #!/bin/bash
2
3 get_boost(){
4     grep -m 1 "Boost version:" ./consoleText | sed  "s/.*-- Boost version: \([a-zA-Z0-9\.]*\)/\1/g"
5 }
6
7 get_compiler(){
8     grep -m 1 "The C compiler identification" ./consoleText | sed  "s/.*-- The C compiler identification is \([a-zA-Z0-9\.]*\)/\1/g"
9 }
10
11 get_java(){
12     grep -m 1 "Found Java:" ./consoleText | sed "s/.*-- Found Java.*found suitable version \"\([a-zA-Z0-9\.]*\)\",.*/\1/g"
13 }
14
15 get_cmake(){
16     grep -m 1 "Cmake version" ./consoleText| sed "s/.*-- Cmake version \([a-zA-Z0-9\.]*\)/\1/g"
17 }
18
19 if [ -f consoleText ]; then
20   rm consoleText
21 fi
22
23
24 if [ -z $BUILD_URL ]; then
25   BUILD_URL="https://ci.inria.fr/simgrid/job/SimGrid/lastBuild"
26 fi
27
28 #get the list of nodes on jenkins
29 wget --quiet ${BUILD_URL}/consoleText >/dev/null 2>&1
30 nodes=($(grep -rR "Triggering SimGrid ? Debug," ./consoleText | sed "s/Triggering SimGrid ? Debug,\(.*\)/\1/g"| sort))
31 rm consoleText
32
33
34 echo "<br>Description of the nodes - Automatically updated by project_description.sh script - Don't edit here<br><br>
35 <table id="configuration-matrix"> 
36 <tr class="matrix-row">  <td class="matrix-header">Name of the Builder</td><td class="matrix-header">OS version</td><td class="matrix-header">Compiler name and version</td><td class="matrix-header">Boost version</td><td class="matrix-header">Java version</td><td class="matrix-header">Cmake version</td></tr>"
37
38 for node in "${nodes[@]}"
39 do
40     wget --quiet ${BUILD_URL}/build_mode=Debug,node=${node}/consoleText >/dev/null 2>&1
41     if [ ! -f consoleText ]; then
42       echo "file not existing for node ${node}"
43       exit 1
44     fi
45     boost=$(get_boost)
46     compiler=$(get_compiler)
47     java=$(get_java)
48     cmake=$(get_cmake)
49     os=$(grep -m 1 "OS Version" ./consoleText| sed "s/OS Version : \(.*\)/\1/g")
50     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></tr>"
51     rm consoleText
52 done
53
54
55 #Travis - get ID of the last jobs with the API
56 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')
57 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 2))
58
59 for id in "${!BUILDS[@]}"
60 do
61     wget --quiet https://api.travis-ci.org/v3/job/${BUILDS[$id]}/log.txt -O ./consoleText >/dev/null 2>&1
62     sed -i -e "s/\r//g" ./consoleText
63     if [ $id == 0 ]; then
64       node="<a href=\"https://travis-ci.org/simgrid/simgrid\">travis-linux</a>"
65       os="Ubuntu 14.04 (<a href=\"https://docs.travis-ci.com/user/reference/trusty/\">Trusty</a>) 64 bits"
66     else
67       node="<a href=\"https://travis-ci.org/simgrid/simgrid\">travis-mac</a>"
68       os="Mac OSX High Sierra (kernel: 17.4.0)"
69     fi
70     boost=$(get_boost)
71     compiler=$(get_compiler)
72     java=$(get_java)
73     cmake=$(get_cmake)
74     
75     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></tr>"
76     rm consoleText
77 done
78
79 #Appveyor - get ID of the last job with the API
80 BUILD_ID=$(curl -s "https://ci.appveyor.com/api/projects/mquinson/simgrid" | grep -o '\[{"jobId":"[a-zA-Z0-9]*",' | sed "s/\[{\"jobId\":\"//" | sed "s/\",//")
81 wget --quiet https://ci.appveyor.com/api/buildjobs/$BUILD_ID/log -O ./consoleText >/dev/null 2>&1
82 sed -i -e "s/\r//g" ./consoleText
83 node="<a href="https://ci.appveyor.com/project/mquinson/simgrid">appveyor</a>"
84 os="Windows Server 2012 - VS2015 + mingw64 5.3.0"
85 boost=$(get_boost)
86 compiler=$(get_compiler)
87 java=$(get_java)
88 cmake=$(get_cmake)
89
90 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></tr>"
91 rm consoleText
92
93 echo "</table>"