release_gate.sh 945 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
  4. cd "$PROJECT_DIR"
  5. if [[ ! -x .venv/bin/python || ! -x .venv/bin/pytest || ! -x .venv/bin/ruff ]]; then
  6. echo "release gate failed: .venv is incomplete" >&2
  7. exit 1
  8. fi
  9. if [[ ! -d web/node_modules ]]; then
  10. echo "release gate failed: web/node_modules is missing; run npm ci in web/" >&2
  11. exit 1
  12. fi
  13. echo "[1/6] Python syntax"
  14. .venv/bin/python -m compileall -q agents api supply_agent supply_infra scripts
  15. echo "[2/6] Static checks for release-critical code"
  16. .venv/bin/ruff check agents/find_agent api supply_infra alembic scripts tests
  17. echo "[3/6] Fresh-database migration"
  18. .venv/bin/pytest -q tests/migrations/test_fresh_database.py
  19. echo "[4/6] Offline regression suite"
  20. .venv/bin/pytest -q
  21. echo "[5/6] Production frontend build"
  22. (
  23. cd web
  24. npm run build
  25. )
  26. echo "[6/6] Patch whitespace"
  27. git diff --check
  28. echo "release gate passed"