summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuildbot/make_auditor_reports.sh37
1 files changed, 12 insertions, 25 deletions
diff --git a/buildbot/make_auditor_reports.sh b/buildbot/make_auditor_reports.sh
index 6fdcc12..1add3cb 100755
--- a/buildbot/make_auditor_reports.sh
+++ b/buildbot/make_auditor_reports.sh
@@ -1,31 +1,18 @@
#!/bin/sh
+# Logic that creates auditor reports, respecting
+# the config file that lives under ${HOME}/.config/taler.conf.
+#
+# Therefore, if the config file mentions the "demo" ("test") DB,
+# then the report will reflect the "demo" ("test") deployment.
-# 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)
-echo "Active color is: $ACTIVE_COLOR"
-
-if test -z ${ACTIVE_COLOR}; then
- echo "Could not outline what the active color is"
- exit 1
-fi
DATE=$(date +%Y-%m-%d)
-REPORT_FILE_NOEXT=/home/${ACTIVE_COLOR}/audit_report.${DATE}
-WIRE_REPORT_FILE_NOEXT=/home/${ACTIVE_COLOR}/wire_audit_report.${DATE}
+REPORT_FILE_NOEXT=${HOME}/audit_report.${DATE}
+WIRE_REPORT_FILE_NOEXT=${HOME}/wire_audit_report.${DATE}
SUDO_COLOR="sudo -u ${ACTIVE_COLOR}"
JINJA_TEMPLATE="auditor-report.tex.j2"
-REPORTS_DIRECTORY="/home/${TALER_DEPLOYMENT}/reports"
+REPORTS_DIRECTORY="${HOME}/reports"
# Add the exchange into the auditor DB.
TALER_AUDITOR_EXCHANGE=$(printf "taler-auditor-exchange -c %s -m %s -u %s" \
@@ -34,10 +21,10 @@ TALER_AUDITOR_EXCHANGE=$(printf "taler-auditor-exchange -c %s -m %s -u %s" \
'$(taler-config -s exchange -o base_url)')
CMD=$(printf "%s; %s" \
- "source /home/${ACTIVE_COLOR}/activate" \
+ "source ${HOME}/activate" \
"${TALER_AUDITOR_EXCHANGE}")
-${SUDO_COLOR} bash -c "$CMD"
+bash -c "$CMD"
# Generate first report.
${SUDO_COLOR} bash -c \
@@ -45,8 +32,8 @@ ${SUDO_COLOR} bash -c \
taler-auditor > ${REPORT_FILE_NOEXT}.txt"
# Generate "wire" report.
-${SUDO_COLOR} bash -c \
- "source /home/${ACTIVE_COLOR}/activate; \
+bash -c \
+ "source ${HOME}/activate; \
taler-wire-auditor > ${WIRE_REPORT_FILE_NOEXT}.txt"
# Convert them into PDF and put them into nginx-served directory.