aboutsummaryrefslogtreecommitdiff
path: root/buildbot/make_auditor_reports.sh
diff options
context:
space:
mode:
Diffstat (limited to 'buildbot/make_auditor_reports.sh')
-rwxr-xr-xbuildbot/make_auditor_reports.sh38
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.