interplane.io
Source of interplane.io: a Rust generator that renders the page from the protocol repository's public record, deployed hourly from the Spark.
Brought by drakestapleton
interplane.io / scripts / tests / fixture-build.sh
| 1 | #!/bin/sh |
| 2 | # Builds both sites from a scratch copy of the tree with the test fixtures placed in content/. |
| 3 | # For screenshots and controls only. The result carries made-up Hop values and a made-up ledger, a |
| 4 | # TEST DATA banner on every page and a TEST-DATA file in each output root: the publisher refuses it. Usage: sh scripts/tests/fixture-build.sh BUILDER OUT HOPOUT (absolute paths) |
| 5 | set -eu |
| 6 | if [ "$#" -ne 3 ]; then |
| 7 | echo 'usage: fixture-build.sh BUILDER OUT HOPOUT' >&2 |
| 8 | exit 2 |
| 9 | fi |
| 10 | ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd) |
| 11 | WORK=$(mktemp -d) |
| 12 | trap 'rm -rf "$WORK"' 0 |
| 13 | trap 'exit 1' 1 2 15 |
| 14 | cp -R "$ROOT/content" "$ROOT/public" "$WORK/" |
| 15 | # The committed tree may carry real release data and receipts: the fixtures replace them, never mix. |
| 16 | rm -rf "$WORK/content/receipts" "$WORK/content/hop.release.txt" "$WORK/content/hop.install.sh" |
| 17 | cp "$ROOT/tests/fixtures/hop.release.txt" "$WORK/content/hop.release.txt" |
| 18 | cp "$ROOT/tests/fixtures/hop.install.sh" "$WORK/content/hop.install.sh" |
| 19 | cp -R "$ROOT/tests/fixtures/receipts" "$WORK/content/receipts" |
| 20 | cd "$WORK" |
| 21 | "$1" build --test-data "$2" "$3" |
| 22 | "$1" verify --test-data "$2" "$3" |