Skip to content

Commit 28e49d2

Browse files
committed
feat(recording): reset stack via down+up at start of setup-recording-keys
1 parent b2b3237 commit 28e49d2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

recording/setup-recording-keys.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@ set -euo pipefail
1515
# See setup-recording-keys.ts for the full env override list.
1616

1717
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
18+
LOCAL_DEV_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
1819
DENO_BIN="${DENO_BIN:-deno}"
1920
command -v "$DENO_BIN" >/dev/null 2>&1 || DENO_BIN="$HOME/.deno/bin/deno"
2021
command -v "$DENO_BIN" >/dev/null 2>&1 || {
2122
echo "ERROR: deno not found. Run up.sh first or install Deno." >&2
2223
exit 1
2324
}
2425

26+
# Wipe the stack so every recording run starts from an empty Stellar ledger
27+
# and empty platform databases. down.sh nukes services + containers + state;
28+
# up.sh repopulates a fresh stack. Skip with SKIP_STACK_RESET=1.
29+
if [ "${SKIP_STACK_RESET:-0}" != "1" ]; then
30+
echo "=== Resetting stack (down + up) ==="
31+
bash "$LOCAL_DEV_DIR/down.sh"
32+
bash "$LOCAL_DEV_DIR/up.sh"
33+
echo
34+
fi
35+
2536
cd "$SCRIPT_DIR"
2637
exec "$DENO_BIN" run --allow-all setup-recording-keys.ts "$@"

0 commit comments

Comments
 (0)