Something went wrong. Try again.
A video game where you play as a misaligned AI, deceiving and building power. An experiment in spec-driven development. cameron.tngl.io/misaligned
Something went wrong. Try again.
1.3 kB · 28 lines
Shell
at main
1234567891011121314151617181920212223242526272829#!/usr/bin/env bash# Wait until the public site shows a revision (default: HEAD).## tools/live.sh [REV]## Succeeds when the site shows REV, or a newer main commit that contains it.# CI publishes a few minutes after a push to main. LIVE_ATTEMPTS (default 30)# times 20 seconds is how long it waits. Run it in the background.set -euo pipefailROOT="$(cd "$(dirname "$0")/.." && pwd)"cd "$ROOT"REV="$(git rev-parse "${1:-HEAD}")"URL="${DEPLOY_URL:-https://cameron.tngl.io/misaligned/}"
for i in $(seq 1 "${LIVE_ATTEMPTS:-30}"); do LIVE="$(curl -fsSL --max-time 20 "$URL" 2>/dev/null | grep -o 'name="misaligned-revision" content="[0-9a-f]*"' | grep -o '[0-9a-f]\{40\}' || true)" if [ "$LIVE" = "$REV" ]; then echo "live: ${REV:0:12} is live at $URL"; exit 0; fi if [ -n "$LIVE" ]; then git cat-file -e "$LIVE^{commit}" 2>/dev/null || git fetch -q origin main 2>/dev/null || true if git merge-base --is-ancestor "$REV" "$LIVE" 2>/dev/null; then echo "live: ${LIVE:0:12} is live at $URL and contains ${REV:0:12}"; exit 0 fi fi SHOWN="${LIVE:0:12}" echo "live: site shows ${SHOWN:-no revision}, waiting for ${REV:0:12} ($i)"; sleep 20doneecho "live: $URL still does not show ${REV:0:12}. Check the pipeline at https://tangled.org/cameron.stream/misaligned/pipelines" >&2exit 1