summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/docker
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/reporting/docker')
-rw-r--r--utils/test/reporting/docker/Dockerfile43
-rwxr-xr-xutils/test/reporting/docker/reporting.sh65
-rw-r--r--utils/test/reporting/docker/requirements.pip12
3 files changed, 120 insertions, 0 deletions
diff --git a/utils/test/reporting/docker/Dockerfile b/utils/test/reporting/docker/Dockerfile
new file mode 100644
index 000000000..789df9115
--- /dev/null
+++ b/utils/test/reporting/docker/Dockerfile
@@ -0,0 +1,43 @@
+########################################
+# Docker container for OPNFV-REPORTING
+########################################
+# Purpose: run opnfv-reporting to provide consistent Testing reporting
+#
+# Maintained by Morgan Richomme
+# Build:
+# $ docker build -t opnfv/testreporting:tag .
+##
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+FROM nginx:stable
+
+MAINTAINER Morgan Richomme <morgan.richomme@orange.com>
+LABEL version="danube.1.0" description="OPNFV Test Reporting Docker container"
+
+ARG BRANCH=master
+
+ENV HOME /home/opnfv
+ENV working_dir /home/opnfv/utils/test/reporting
+ENV TERM xterm
+ENV COLORTERM gnome-terminal
+ENV CONFIG_REPORTING_YAML /home/opnfv/utils/test/reporting/reporting.yaml
+
+# Packaged dependencies
+RUN apt-get update && apt-get install -y \
+ssh \
+git-core \
+wkhtmltopdf \
+--no-install-recommends
+
+RUN pip install --upgrade pip
+
+RUN pip install -r ${working_dir}/docker/requirements.txt
+RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng /home/opnfv
+
+WORKDIR ${working_dir}
+CMD ["bash", "./docker/reporting.sh"]
+CMD ["bash", "mv display /usr/share/nginx/html"]
diff --git a/utils/test/reporting/docker/reporting.sh b/utils/test/reporting/docker/reporting.sh
new file mode 100755
index 000000000..5d4ea11f4
--- /dev/null
+++ b/utils/test/reporting/docker/reporting.sh
@@ -0,0 +1,65 @@
+#!/bin/bash
+cd ..
+
+export PYTHONPATH="${PYTHONPATH}:."
+export CONFIG_REPORTING_YAML=./reporting.yaml
+
+declare -a versions=(colorado master)
+declare -a projects=(functest yardstick)
+
+project=$1
+reporting_type=$2
+
+# create Directories if needed
+for i in "${versions[@]}"
+do
+ for j in "${projects[@]}"
+ do
+ mkdir -p display/$i/$j
+ done
+done
+
+# copy images, js, css, 3rd_party
+cp -Rf 3rd_party display
+cp -Rf css display
+cp -Rf html/* display
+cp -Rf img display
+cp -Rf js display
+
+# if nothing is precised run all the reporting generation
+# projet | option
+# $1 | $2
+# functest | status, vims, tempest
+# yardstick |
+
+if [ -z "$1" ]; then
+ echo "********************************"
+ echo " Functest reporting "
+ echo "********************************"
+ echo "reporting vIMS..."
+ python ./functest/reporting-vims.py
+ echo "reporting vIMS...OK"
+ sleep 10
+ echo "reporting Tempest..."
+ python ./functest/reporting-tempest.py
+ echo "reporting Tempest...OK"
+ sleep 10
+ echo "reporting status..."
+ python ./functest/reporting-status.py
+ echo "Functest reporting status...OK"
+
+ echo "********************************"
+ echo " Yardstick reporting "
+ echo "********************************"
+ python ./yardstick/reporting-status.py
+ echo "Yardstick reporting status...OK"
+else
+ if [ -z "$2" ]; then
+ reporting_type="status"
+ fi
+ echo "********************************"
+ echo " $project/$reporting_type reporting "
+ echo "********************************"
+ python ./$project/reporting-$reporting_type.py
+fi
+
diff --git a/utils/test/reporting/docker/requirements.pip b/utils/test/reporting/docker/requirements.pip
new file mode 100644
index 000000000..21d5ba97a
--- /dev/null
+++ b/utils/test/reporting/docker/requirements.pip
@@ -0,0 +1,12 @@
+#
+#
+# author: Morgan Richomme (morgan.richomme@orange.com)
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+pdfkit==0.5.0
+PyYAML==3.11
+simplejson==3.8.1