22 lines
851 B
Bash
Executable File
22 lines
851 B
Bash
Executable File
#!/usr/bin/env sh
|
|
# InboxIntel pre-push hook — build + test gate. Mirrors what Gitea CI runs so you
|
|
# catch failures before they reach the server. Bypass with: git push --no-verify
|
|
set -eu
|
|
|
|
echo "[pre-push] building solution (Release)..."
|
|
dotnet build InboxIntel.sln -c Release --nologo \
|
|
|| { echo "[pre-push] BLOCKED: backend build failed."; exit 1; }
|
|
|
|
echo "[pre-push] running tests..."
|
|
dotnet test InboxIntel.sln -c Release --no-build --nologo \
|
|
|| { echo "[pre-push] BLOCKED: tests failed."; exit 1; }
|
|
|
|
# Frontend build (only if the app is present and npm is installed).
|
|
if [ -f frontend/package.json ] && command -v npm >/dev/null 2>&1; then
|
|
echo "[pre-push] frontend build..."
|
|
( cd frontend && npm run build --silent ) \
|
|
|| { echo "[pre-push] BLOCKED: frontend build failed."; exit 1; }
|
|
fi
|
|
|
|
echo "[pre-push] OK — safe to push."
|