2026-02-12 15:46:57 -08:00
#!/usr/bin/env bash
# Run all tasks that do NOT require LAN, Proxmox SSH, PRIVATE_KEY, or NPM_PASSWORD.
# Use from dev machine / WSL / CI. For tasks that need LAN/creds, see run-operator-tasks-from-lan.sh.
2026-02-21 15:46:06 -08:00
# Usage: ./scripts/run-completable-tasks-from-anywhere.sh [--dry-run]
# --dry-run Print the four steps only; do not run them (exit 0).
#
# Exit codes (Unix convention): 0 = success (all steps passed), non-zero = failure.
# Do not "fix" exit 0 — it means the script completed successfully.
2026-02-12 15:46:57 -08:00
set -euo pipefail
SCRIPT_DIR = " $( cd " $( dirname " ${ BASH_SOURCE [0] } " ) " && pwd ) "
PROJECT_ROOT = " $( cd " $SCRIPT_DIR /.. " && pwd ) "
cd " $PROJECT_ROOT "
2026-02-21 15:46:06 -08:00
DRY_RUN = false
for a in " $@ " ; do [ [ " $a " = = "--dry-run" ] ] && DRY_RUN = true && break; done
if $DRY_RUN ; then
echo "=== Completable from anywhere (--dry-run: commands only) ==="
echo ""
echo "1. Config validation: bash scripts/validation/validate-config-files.sh [--dry-run]"
echo "2. On-chain check (138): SKIP_EXIT=1 bash scripts/verify/check-contracts-on-chain-138.sh || true"
echo "3. All validation: bash scripts/verify/run-all-validation.sh --skip-genesis"
echo "4. Reconcile .env: bash scripts/verify/reconcile-env-canonical.sh --print"
echo ""
echo "Run without --dry-run to execute. Exit 0 = success."
exit 0
fi
2026-02-12 15:46:57 -08:00
echo "=== Completable from anywhere (no LAN/creds) ==="
echo ""
# 1. Config validation
2026-03-02 11:37:34 -08:00
echo "[Step 1/4] Config validation..."
2026-02-12 15:46:57 -08:00
bash scripts/validation/validate-config-files.sh
echo ""
# 2. On-chain contract check (Chain 138) — may warn if RPC unreachable
2026-03-02 11:37:34 -08:00
echo "[Step 2/4] On-chain contract check (Chain 138)..."
2026-02-12 15:46:57 -08:00
SKIP_EXIT = 1 bash scripts/verify/check-contracts-on-chain-138.sh || true
echo ""
# 3. Full validation (skip genesis to avoid RPC)
2026-03-02 11:37:34 -08:00
echo "[Step 3/4] Run all validation (--skip-genesis)..."
2026-02-12 15:46:57 -08:00
bash scripts/verify/run-all-validation.sh --skip-genesis
echo ""
# 4. Emit canonical .env lines for reconciliation
2026-03-02 11:37:34 -08:00
echo "[Step 4/4] Canonical .env (reconcile smom-dbis-138/.env)..."
2026-02-12 15:46:57 -08:00
bash scripts/verify/reconcile-env-canonical.sh --print
echo ""
echo "=== Done. Tasks requiring LAN or credentials: run scripts/run-operator-tasks-from-lan.sh from a host on LAN with NPM_PASSWORD/PRIVATE_KEY set. ==="
2026-02-21 15:46:06 -08:00
exit 0