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