| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | repo_root="$(git rev-parse --show-toplevel)" |
| 5 | "$repo_root/scripts/validate-release-control-plane.sh" "$repo_root" |
| 6 | |
| 7 | fixture="$(mktemp -d "${TMPDIR:-/tmp}/reasonix-release-control-test.XXXXXX")" |
| 8 | cleanup() { |
| 9 | case "$fixture" in */reasonix-release-control-test.*) rm -rf -- "$fixture" ;; *) exit 1 ;; esac |
| 10 | } |
| 11 | trap cleanup EXIT |
| 12 | |
| 13 | while IFS= read -r file; do |
| 14 | mkdir -p "$fixture/$(dirname "$file")" |
| 15 | cp "$repo_root/$file" "$fixture/$file" |
| 16 | done < <(awk ' |
| 17 | /^required=\(/ { collecting = 1; next } |
| 18 | collecting && /^\)/ { exit } |
| 19 | collecting { sub(/^[[:space:]]*/, ""); print } |
| 20 | ' "$repo_root/scripts/validate-release-control-plane.sh") |
| 21 | chmod +x "$fixture/scripts/finalize-windows-signed-candidate.sh" "$fixture/scripts/package-windows-desktop.sh" |
| 22 | |
| 23 | for helper in scripts/sign-certum.ps1 scripts/windows-acceptance-environment.ps1 scripts/windows-upgrade-ui-evidence.ps1; do |
| 24 | truncate -s 0 "$fixture/$helper" |
| 25 | if "$repo_root/scripts/validate-release-control-plane.sh" "$fixture" >"$fixture/missing.log" 2>&1; then |
| 26 | echo "incomplete release control checkout unexpectedly passed" >&2 |
| 27 | exit 1 |
| 28 | fi |
| 29 | grep -Fq "missing release control file: $helper" "$fixture/missing.log" |
| 30 | cp "$repo_root/$helper" "$fixture/$helper" |
| 31 | done |
| 32 | |
| 33 | echo "release control preflight tests: PASS" |
| 34 |