diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-12-05 19:50:49 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-12-05 19:50:49 +0100 |
commit | e33ad1e6759801bdee5d94c6a71ff0326bbc4842 (patch) | |
tree | dfa1eecbf780eb428e53f2f6759b6eee250cd9b4 | |
parent | 043e3b95e743185fdb55426dfbba5b1294dadac4 (diff) | |
download | deployment-e33ad1e6759801bdee5d94c6a71ff0326bbc4842.tar.gz deployment-e33ad1e6759801bdee5d94c6a71ff0326bbc4842.tar.bz2 deployment-e33ad1e6759801bdee5d94c6a71ff0326bbc4842.zip |
Stringified CMDs are now useless.
-rwxr-xr-x | buildbot/make_auditor_reports.sh | 51 |
1 files changed, 19 insertions, 32 deletions
diff --git a/buildbot/make_auditor_reports.sh b/buildbot/make_auditor_reports.sh index 17299b7..b423d10 100755 --- a/buildbot/make_auditor_reports.sh +++ b/buildbot/make_auditor_reports.sh @@ -6,6 +6,8 @@ # Therefore, if the config file mentions the "demo" ("test") DB, # then the report will reflect the "demo" ("test") deployment. +# Exit on non-zero exits. +set -e DATE=$(date +%Y-%m-%d) REPORT_FILE_NOEXT=${HOME}/audit_report.${DATE} @@ -13,49 +15,34 @@ WIRE_REPORT_FILE_NOEXT=${HOME}/wire_audit_report.${DATE} JINJA_TEMPLATE="auditor-report.tex.j2" REPORTS_DIRECTORY="${HOME}/reports" -# Add the exchange into the auditor DB. -TALER_AUDITOR_EXCHANGE=$(printf "taler-auditor-exchange -c %s -m %s -u %s" \ - '${HOME}/.config/taler.conf' \ - '$(taler-config -s exchange -o master_public_key)' \ - '$(taler-config -s exchange -o base_url)') +source ${HOME}/activate -CMD=$(printf "%s; %s" \ - "source ${HOME}/activate" \ - "${TALER_AUDITOR_EXCHANGE}") - -bash -c "$CMD" +taler-auditor-exchange \ + -c ${HOME}/.config/taler.conf \ + -m $(taler-config -s exchange -o master_public_key) \ + -u $(taler-config -s exchange -o base_url) # Generate first report. -bash -c \ - "source ${HOME}/activate; \ - taler-auditor > ${REPORT_FILE_NOEXT}.txt" +taler-auditor > "${REPORT_FILE_NOEXT}.txt" # Generate "wire" report. -bash -c \ - "source ${HOME}/activate; \ - taler-wire-auditor > ${WIRE_REPORT_FILE_NOEXT}.txt" - -# Convert them into PDF and put them into nginx-served directory. -if ! sh -c \ - "./render_auditor_reports.py \ - ${REPORT_FILE_NOEXT}.txt \ - ${WIRE_REPORT_FILE_NOEXT}.txt \ - > ${REPORT_FILE_NOEXT}.tex \ - < ${JINJA_TEMPLATE}"; then -echo -echo "Could not generate the TEX template (from Jinja)." -exit 1 -fi +taler-wire-auditor > "${WIRE_REPORT_FILE_NOEXT}.txt" + +python ${PWD}/render_auditor_reports.py \ + "${REPORT_FILE_NOEXT}.txt" \ + "${WIRE_REPORT_FILE_NOEXT}.txt" \ + > "${REPORT_FILE_NOEXT}.tex" + < "${JINJA_TEMPLATE}" # POLISHING ENDS HERE. -pdflatex \ - --output-directory $REPORTS_DIRECTORY \ - "${REPORT_FILE_NOEXT}.tex" +cd "${REPORTS_DIRECTORY}" +pdflatex "${REPORT_FILE_NOEXT}.tex" rm \ "${REPORT_FILE_NOEXT}.log" \ "${REPORT_FILE_NOEXT}.tex" \ - "${REPORT_FILE_NOEXT}.txt" + "${REPORT_FILE_NOEXT}.txt" \ + "${WIRE_REPORT_FILE_NOEXT}.txt" echo "The file ${REPORT_FILE_NOEXT}.pdf" has been correctly generated. |