Commit 583dd1d52b87edcb2220066fff5db452c38c883e
1 parent
bb3bd4ab
chore(infra): source .env.local in scripts/test.sh for pre-push hook
Showing
1 changed file
with
5 additions
and
0 deletions
scripts/test.sh
| ... | ... | @@ -8,6 +8,11 @@ set -euo pipefail |
| 8 | 8 | PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)" |
| 9 | 9 | cd "$PROJECT_ROOT" |
| 10 | 10 | |
| 11 | +# 加载 .env.local(DB_HOST/DB_PORT/JWT_SECRET 等),让 mvn / setup-test-db.sh 都能读到 | |
| 12 | +if [ -f .env.local ]; then | |
| 13 | + set -a; . ./.env.local; set +a | |
| 14 | +fi | |
| 15 | + | |
| 11 | 16 | echo "[test.sh] 1/6 setup test db" |
| 12 | 17 | ./scripts/setup-test-db.sh |
| 13 | 18 | ... | ... |