diff options
-rwxr-xr-x | buildbot/make_auditor_reports.sh | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/buildbot/make_auditor_reports.sh b/buildbot/make_auditor_reports.sh index 1f66eb1..df7fdc4 100755 --- a/buildbot/make_auditor_reports.sh +++ b/buildbot/make_auditor_reports.sh @@ -14,33 +14,19 @@ source ${HOME}/activate taler-deployment build DATE=$(date +%Y-%m-%d) -REPORT_FILE_NOEXT="${HOME}/audit_report.${DATE}" -WIRE_REPORT_FILE_NOEXT="${HOME}/wire_audit_report.${DATE}" -JINJA_TEMPLATE="auditor-report.tex.j2" REPORTS_DIRECTORY=$(taler-config -s auditor -o reports -f) +mkdir -p "${REPORTS_DIRECTORY}" +REPORT_FILE="${REPORTS_DIRECTORY}/${DATE}-report.pdf" -clean_files () { - # Remove garbage and set permissions. - echo Removing "${REPORT_FILE_NOEXT}.aux" - rm -f "${REPORT_FILE_NOEXT}.aux" - echo Removing "${REPORT_FILE_NOEXT}.tex" - rm -f "${REPORT_FILE_NOEXT}.tex" - echo Removing "${REPORT_FILE_NOEXT}.log" - rm -f "${REPORT_FILE_NOEXT}.log" - echo Removing "${REPORT_FILE_NOEXT}.txt", "${WIRE_REPORT_FILE_NOEXT}.txt" - rm -f "${REPORT_FILE_NOEXT}.txt" "${WIRE_REPORT_FILE_NOEXT}.txt" -} - - -if test -a ${REPORTS_DIRECTORY}/$(basename "${REPORT_FILE_NOEXT}.pdf"); then +if test -a "${REPORT_FILE}" +then echo "Today's report already compiled!" exit 0 fi CONFIG_FILE="${TALER_HOME}/.config/taler.conf" - -# Generate first report. +# Generate today's report. echo "Running taler-auditor" if ! taler-auditor -c ${CONFIG_FILE} | tee build-log.txt; then echo "taler-auditor failed" @@ -55,12 +41,10 @@ if ! test -f "${REPORT}"; then exit 1 fi -mkdir -p "${REPORTS_DIRECTORY}" chmod 444 "${REPORT}" -mv "${REPORT}" "${REPORTS_DIRECTORY}" -echo Reports moved in "${REPORTS_DIRECTORY}". +mv "${REPORT}" "${REPORT_FILE}" +echo "Report moved to ${REPORTS_DIRECTORY}." -clean_files rm -r `dirname $REPORT` exit 0 |