diff --git a/README.md b/README.md index d1d2b8f..d0c5868 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,15 @@ scripts/workflow.sh draft DIAGNOSTIC EVIDENCE_ROOT OUTPUT_DIR TITLE AUTHOR DATE scripts/workflow.sh render REPORT OUTPUT ``` +Process every JSON capture in a directory tree through all stages with: + +```bash +scripts/workflow-all.sh CAPTURE_DIR EVIDENCE_ROOT OUTPUT_ROOT REFERENCE_TIME TITLE AUTHOR DATE +``` + +This creates parallel `diagnostics`, `generations`, and `pdfs` trees beneath a +new output root. + ## Reproducibility Git submodules pin exact component commits instead of following branch heads. diff --git a/diagnostics b/diagnostics index 1fa6555..c28c4ec 160000 --- a/diagnostics +++ b/diagnostics @@ -1 +1 @@ -Subproject commit 1fa65558130be2b91bd15a26ba729b7b4c6b787d +Subproject commit c28c4ec2701017a9fc0690dad9eef68225a9fa58 diff --git a/reporter b/reporter index b71c168..a41ba1b 160000 --- a/reporter +++ b/reporter @@ -1 +1 @@ -Subproject commit b71c168a7f710df1e639d58064b4a3b5f5d5081d +Subproject commit a41ba1bb87ce91f47f5ca154e27a815f48954034 diff --git a/reports b/reports index f5539cf..89c4ebe 160000 --- a/reports +++ b/reports @@ -1 +1 @@ -Subproject commit f5539cf88f179f5436473f5657cadb41ce54a6d0 +Subproject commit 89c4ebed81d5a78bdd4dd88688e4686b89a44ee8 diff --git a/scripts/workflow-all.sh b/scripts/workflow-all.sh new file mode 100755 index 0000000..9a68a81 --- /dev/null +++ b/scripts/workflow-all.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")/.." +if [[ $# -ne 7 ]]; then + echo "Usage: $0 CAPTURE_DIR EVIDENCE_ROOT OUTPUT_ROOT REFERENCE_TIME TITLE AUTHOR DATE" >&2 + exit 2 +fi +capture_dir=$1; evidence_root=$2; output_root=$3; reference_time=$4; title=$5; author=$6; report_date=$7 +[[ ! -e "$output_root" ]]||{ echo "$output_root: output root already exists" >&2; exit 1; } +mkdir -p "$output_root" +diagnostics/tools/analyse-all.sh "$capture_dir" --evidence-root "$evidence_root" \ + --output-dir "$output_root/diagnostics" --reference-time "$reference_time" \ + --producer-version "$(git -C diagnostics rev-parse HEAD)" +reports/tools/diagnostic-to-report-all.sh --diagnostic-dir "$output_root/diagnostics" \ + --evidence-root "$evidence_root" --output-root "$output_root/generations" \ + --title "$title" --author "$author" --date "$report_date" \ + --generator-version "$(git -C reports rev-parse HEAD)" \ + --diagnostic-validator "$PWD/diagnostics/tools/validate.sh" \ + --report-validator "$PWD/reporter/tools/validate.sh" \ + --branding "$PWD/reports/config/branding/default.json" --branding-root "$PWD/reports" +while IFS= read -r -d '' report; do + relative=${report#"$output_root/generations/"}; relative=${relative%/report.draft.json} + reporter/tools/render.sh "$report" --output "$output_root/pdfs/$relative.pdf" +done < <(find "$output_root/generations" -type f -name report.draft.json -print0 | sort -z) +echo "Created diagnostics, draft generations, and PDFs under $output_root"