interplane.Get Omega
Read in your language

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

branch main Branches Tags History

interplane.io / scripts / tests / fixture-build.sh

22 lines · 1130 bytes Raw Blame History
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)
5set -eu
6if [ "$#" -ne 3 ]; then
7 echo 'usage: fixture-build.sh BUILDER OUT HOPOUT' >&2
8 exit 2
9fi
10ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
11WORK=$(mktemp -d)
12trap 'rm -rf "$WORK"' 0
13trap 'exit 1' 1 2 15
14cp -R "$ROOT/content" "$ROOT/public" "$WORK/"
15# The committed tree may carry real release data and receipts: the fixtures replace them, never mix.
16rm -rf "$WORK/content/receipts" "$WORK/content/hop.release.txt" "$WORK/content/hop.install.sh"
17cp "$ROOT/tests/fixtures/hop.release.txt" "$WORK/content/hop.release.txt"
18cp "$ROOT/tests/fixtures/hop.install.sh" "$WORK/content/hop.install.sh"
19cp -R "$ROOT/tests/fixtures/receipts" "$WORK/content/receipts"
20cd "$WORK"
21"$1" build --test-data "$2" "$3"
22"$1" verify --test-data "$2" "$3"