Document that ./gradlew check must pass before every commit. Add scripts to run the same verification as CI and optionally install a git hook. Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
786 B
Bash
Executable file
20 lines
786 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Runs the same verification as CI before allowing a commit.
|
|
# Install: ./scripts/install-pre-commit-hook.sh
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT="$(git rev-parse --show-toplevel)"
|
|
cd "$ROOT"
|
|
|
|
export POSTGRES_DB="${POSTGRES_DB:-bilhej}"
|
|
export POSTGRES_USER="${POSTGRES_USER:-bilhej}"
|
|
export POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-test_pw_ci_123}"
|
|
export JWT_SECRET="${JWT_SECRET:-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}"
|
|
export STRIPE_SECRET_KEY="${STRIPE_SECRET_KEY:-sk_test_fake}"
|
|
export STRIPE_WEBHOOK_SECRET="${STRIPE_WEBHOOK_SECRET:-whsec_fake}"
|
|
export STRIPE_PRICE_ID="${STRIPE_PRICE_ID:-price_fake}"
|
|
|
|
echo "pre-commit: running ./gradlew check (lint + unit + E2E in Docker)..."
|
|
./gradlew check --no-daemon
|
|
echo "pre-commit: all checks passed."
|