diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-11-29 01:56:17 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-11-29 01:56:17 +0100 |
commit | 9d1b609be4ef6f6977b5a19a3835cb650c03e75f (patch) | |
tree | 269a2bb2c4d8bcc295c440c28f7fac339a9de022 /buildbot/make_auditor_reports.sh | |
parent | 546704cf4d80dae6b0c611b26333e65ed3d96a32 (diff) | |
download | deployment-9d1b609be4ef6f6977b5a19a3835cb650c03e75f.tar.gz deployment-9d1b609be4ef6f6977b5a19a3835cb650c03e75f.tar.bz2 deployment-9d1b609be4ef6f6977b5a19a3835cb650c03e75f.zip |
Auditor deployment.
Putting reports generating logic.
Diffstat (limited to 'buildbot/make_auditor_reports.sh')
-rwxr-xr-x | buildbot/make_auditor_reports.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/buildbot/make_auditor_reports.sh b/buildbot/make_auditor_reports.sh new file mode 100755 index 0000000..1e06173 --- /dev/null +++ b/buildbot/make_auditor_reports.sh @@ -0,0 +1,38 @@ +#!/bin/sh + + +# Remove once ready! +echo "Auditor report generation is work in progress.." +return 1 + +# 1 generate reports. + +if test -z ${TALER_DEPLOYMENT}; then + echo "Please export env variable TALER_DEPLOYMENT=(test|demo) before running this script" + exit 1 +fi + +ACTIVE_COLOR=$(sudo -u ${TALER_DEPLOYMENT} cat /home/${TALER_DEPLOYMENT}/active) +DATE=$(date +%Y-%m-%d_%H-%M) +REPORT_FILE=/home/${ACTIVE_COLOR}/audit_report.${DATE} +SUDO_COLOR="sudo -u ${ACTIVE_COLOR}" +JINJA_TEMPLATE="auditor-report.tex.j2" +REPORTS_DIRECTORY="/home/${ACTIVE_COLOR}/fixme" + +${SUDO_COLOR} taler-auditor > ${REPORT_FILE}.txt + +# 2 convert them into PDF. +# 3 put them into nginx-served directory. + +${SUDO_COLOR} ./render_auditor_reports.py \ + "${REPORT_FILE}.txt" > "${REPORT_FILE}.tex" \ + < ${JINJA_TEMPLATE} + +${SUDO_COLOR} pdflatex \ + --output-directory $REPORTS_DIRECTORY \ + "${REPORT_FILE}.tex" + +${SUDO_COLOR} rm + "$REPORTS_DIRECTORY/${REPORT_FILE}.log" + +echo "The file ${REPORT_FILE}.pdf" has been correctly generated. |