diff --git a/tools/site-deploy-from-mirror.sh b/tools/site-deploy-from-mirror.sh index b0e4f45ab..02070742a 100755 --- a/tools/site-deploy-from-mirror.sh +++ b/tools/site-deploy-from-mirror.sh @@ -17,8 +17,14 @@ set -euo pipefail LIVE_NETWORK="${LIVE_NETWORK:-igneum-devnet-3}" INDEX_STRINGS=("At launch the strongest chip in our public model" "git.igneum.network/igneum-network/") LEGAL_PAGE="${LEGAL_PAGE:-/litepaper}"; LEGAL_STRING="Not legal advice" # the legal line lives on the litepaper in master's tree (22:16 UK: no commit put it on the index) -MINERS_MIN_ROWS="${MINERS_MIN_ROWS:-30}" +MINERS_MIN_ROWS="${MINERS_MIN_ROWS:-20}" # the current-class table alone (the datacentre rows sit in their own table since 8 Oct 2026) SITE="${SITE_URL:-https://igneum.network}" +# the /miners row count: the rows of the current-class table (table#bench-current, the regrouped bench of 8 Oct 2026; the datacentre +# and earlier tables sit under their own ids); known-failed: an empty table reads 0 +miners_rows() { printf '%s' "$1" | python3 -c ' +import sys,re +h=sys.stdin.read(); m=re.search(r"]*id=\"bench-current\".*?", h, re.S) +print(len(re.findall(r"/dev/null) || { echo "$LEGAL_PAGE: not reachable"; return 1; } printf '%s' "$legal" | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } local miners; miners=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null) || { echo "miners: not reachable"; return 1; } - rows=$(printf '%s' "$miners" | /usr/bin/grep -c '/dev/null 2>&1 && { echo "post-deploy self-test: FAIL: a wrong network passed"; exit 1; } out=$(LIVE_NETWORK="igneum-no-such-network" post_checks 2>&1 || true); case "$out" in "api/live network:"*) ;; *) echo "post-deploy self-test: FAIL: the wrong-network line was '$out'"; exit 1 ;; esac INDEX_STRINGS=("no such string on any page 7f3a") LIVE_NETWORK="$(curl -fsS --max-time 20 "$SITE/api/live" | python3 -c 'import sys,json; print(json.load(sys.stdin)["state"]["network"])')" post_checks >/dev/null 2>&1 && { echo "post-deploy self-test: FAIL: a missing index string passed"; exit 1; } - echo "post-deploy self-test: a wrong network and a missing index string read RED with the field" + [ "$(miners_rows '
')" = 0 ] || { echo "post-deploy self-test: FAIL: an empty current table did not read 0 rows"; exit 1; } + [ "$(miners_rows '
')" = 2 ] || { echo "post-deploy self-test: FAIL: two rows did not read 2"; exit 1; } + echo "post-deploy self-test: a wrong network and a missing index string read RED with the field; an empty current table reads 0 rows, two rows read 2" echo "live site now: $(post_checks 2>&1 || true)" exit 0 fi