| … | … | @@ -0,0 +1,51 @@ |
| 1 | #!/usr/bin/env bash |
| 2 | # go-live.sh — one-shot release: test, publish the web drive, restage the |
| 3 | # Pear terminal app, and seed everything to the hiverelay fleet. |
| 4 | # |
| 5 | # Run from any checkout on a machine with normal internet access (the DHT |
| 6 | # needs UDP) and your Pear writer keys (the machine that first ran |
| 7 | # `pear touch` for the link below, or one sharing its Pear state). |
| 8 | # |
| 9 | # ./scripts/go-live.sh # full release |
| 10 | # SKIP_TESTS=1 ./scripts/go-live.sh # skip the test suite (~5 min faster) |
| 11 | # SKIP_PEAR=1 ./scripts/go-live.sh # web drive + seeding only, no pear stage |
| 12 | set -euo pipefail |
| 13 | |
| 14 | PEAR_LINK="pear://dqz1e6fwyrz1mxj7eqsmcar3hnegrj491t5hnqjm9mda9tz8dzfy" |
| 15 | ROOT="$(cd "$(dirname "$0")/.." && pwd)" |
| 16 | cd "$ROOT" |
| 17 | |
| 18 | echo "== p2pbuilders go-live ==" |
| 19 | |
| 20 | echo "-- install deps" |
| 21 | npm install |
| 22 | |
| 23 | if [ "${SKIP_TESTS:-0}" != "1" ]; then |
| 24 | echo "-- test suite (SKIP_TESTS=1 to skip)" |
| 25 | npm test |
| 26 | fi |
| 27 | |
| 28 | echo "-- publish web drive to hiverelay" |
| 29 | (cd web && node publish.mjs) |
| 30 | NEW_KEY=$(node -e "console.log(JSON.parse(require('fs').readFileSync('web/manifest.json','utf8')).driveKey || '')") |
| 31 | echo " web build live at: hyper://${NEW_KEY}/" |
| 32 | |
| 33 | if [ "${SKIP_PEAR:-0}" != "1" ]; then |
| 34 | echo "-- stage + release the terminal app (${PEAR_LINK})" |
| 35 | command -v pear >/dev/null 2>&1 || { |
| 36 | echo " pear is not on PATH. install once: npm i -g pear && pear (then open a new terminal)" |
| 37 | exit 1 |
| 38 | } |
| 39 | # pear-electron/pre chokes on paths with spaces — stage via a space-free symlink. |
| 40 | ln -sfn "$ROOT" /tmp/p2pbuilders-stage |
| 41 | (cd /tmp/p2pbuilders-stage && pear stage --no-ask "$PEAR_LINK" . && pear release "$PEAR_LINK" .) |
| 42 | fi |
| 43 | |
| 44 | echo "" |
| 45 | echo "== done. two follow-ups ==" |
| 46 | echo "1. commit the updated web/manifest.json (new drive key) and refresh the" |
| 47 | echo " hyper:// link at the bottom of README.md if the key changed." |
| 48 | echo "2. seeding: the next command asks the fleet to pin the pear app key and" |
| 49 | echo " stays alive while relays catch up — Ctrl-C once it prints seeded." |
| 50 | echo "" |
| 51 | exec node scripts/seed-pear.js "$PEAR_LINK" |