Files
Inboxintel/scripts/git-hooks/pre-push
cesnimda ae8e6b672e
CI / backend (push) Successful in 1m14s
CI / frontend (push) Successful in 28s
Security / secrets (push) Successful in 6s
Security / dependencies (push) Successful in 1m14s
Deploy Staging / deploy (push) Failing after 43s
Git workflow, environments & CI/CD pipeline (#1)
2026-07-01 11:44:34 +02:00

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."