7fe97a88e9506869466029859d6aacaded227b8a
[releng.git] / utils / test / reporting / docker / reporting.sh
1 #!/bin/bash
2
3 export PYTHONPATH="${PYTHONPATH}:."
4 export CONFIG_REPORTING_YAML=./reporting.yaml
5
6 declare -a versions=(danube master)
7 declare -a projects=(functest storperf yardstick)
8
9 project=$1
10 reporting_type=$2
11
12 # create Directories if needed
13 for i in "${versions[@]}"
14 do
15     for j in "${projects[@]}"
16        do
17            mkdir -p display/$i/$j
18        done
19 done
20
21 # copy images, js, css, 3rd_party
22 cp -Rf 3rd_party display
23 cp -Rf css display
24 cp -Rf html/* display
25 cp -Rf img display
26 cp -Rf js display
27
28 # if nothing is precised run all the reporting generation
29 #  projet   |        option
30 #   $1      |          $2
31 # functest  | status, vims, tempest
32 # yardstick |
33 # storperf  |
34
35 function report_project()
36 {
37   project=$1
38   dir=$2
39   type=$3
40   echo "********************************"
41   echo " $project reporting "
42   echo "********************************"
43   python ./$dir/reporting-$type.py
44   if [ $? ]; then
45     echo "$project reporting $type...OK"
46   else
47     echo "$project reporting $type...KO"
48   fi
49 }
50
51 if [ -z "$1" ]; then
52   echo "********************************"
53   echo " Functest reporting "
54   echo "********************************"
55   echo "reporting vIMS..."
56   python ./functest/reporting-vims.py
57   echo "reporting vIMS...OK"
58   sleep 10
59   echo "reporting Tempest..."
60   python ./functest/reporting-tempest.py
61   echo "reporting Tempest...OK"
62   sleep 10
63   echo "reporting status..."
64   python ./functest/reporting-status.py
65   echo "Functest reporting status...OK"
66
67   echo "********************************"
68   echo " Yardstick reporting "
69   echo "********************************"
70   python ./yardstick/reporting-status.py
71   echo "Yardstick reporting status...OK"
72
73   echo "********************************"
74   echo " Storperf reporting "
75   echo "********************************"
76   python ./storperf/reporting-status.py
77   echo "Storperf reporting status...OK"
78
79   report_project "QTIP" "qtip" "status"
80
81 else
82   if [ -z "$2" ]; then
83     reporting_type="status"
84   fi
85   echo "********************************"
86   echo " $project/$reporting_type reporting "
87   echo "********************************"
88   python ./$project/reporting-$reporting_type.py
89 fi
90 cp -r display /usr/share/nginx/html
91
92
93 # nginx config
94 cp /home/opnfv/utils/test/reporting/docker/nginx.conf /etc/nginx/conf.d/
95 echo "daemon off;" >> /etc/nginx/nginx.conf
96
97 # supervisor config
98 cp /home/opnfv/utils/test/reporting/docker/supervisor.conf /etc/supervisor/conf.d/
99
100 ln -s /usr/bin/nodejs /usr/bin/node
101
102 cd pages && /bin/bash angular.sh