1de13ae32e59d149269b55ae1a7487a35a33fdd1
[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=(colorado 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 if [ -z "$1" ]; then
36   echo "********************************"
37   echo " Functest reporting "
38   echo "********************************"
39   echo "reporting vIMS..."
40   python ./functest/reporting-vims.py
41   echo "reporting vIMS...OK"
42   sleep 10
43   echo "reporting Tempest..."
44   python ./functest/reporting-tempest.py
45   echo "reporting Tempest...OK"
46   sleep 10
47   echo "reporting status..."
48   python ./functest/reporting-status.py
49   echo "Functest reporting status...OK"
50
51   echo "********************************"
52   echo " Yardstick reporting "
53   echo "********************************"
54   python ./yardstick/reporting-status.py
55   echo "Yardstick reporting status...OK"
56
57   echo "********************************"
58   echo " Storperf reporting "
59   echo "********************************"
60   python ./storperf/reporting-status.py
61   echo "Storperf reporting status...OK"
62
63 else
64   if [ -z "$2" ]; then
65     reporting_type="status"
66   fi
67   echo "********************************"
68   echo " $project/$reporting_type reporting "
69   echo "********************************"
70   python ./$project/reporting-$reporting_type.py
71 fi
72 cp -r display /usr/share/nginx/html
73
74
75 # nginx config
76 cp /home/opnfv/utils/test/reporting/docker/nginx.conf /etc/nginx/conf.d/
77 echo "daemon off;" >> /etc/nginx/nginx.conf
78
79 # supervisor config
80 cp /home/opnfv/utils/test/reporting/docker/supervisor.conf /etc/supervisor/conf.d/
81
82 ln -s /usr/bin/nodejs /usr/bin/node