File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,9 @@ echo "🔍 Starte Qualitäts-Checks vor dem Push..."
77
88# 1. Schnelle Tests ausführen (Quality Gate – blockierend)
99echo " ⏳ Starte npm run test:fast..."
10- LOG_LEVEL=warn npx vitest run --exclude tests/server/load-suite.test.ts --exclude tests/integration/serial-flow.test.ts
11- if [ $? -ne 0 ]; then
10+ if LOG_LEVEL=warn npx vitest run --exclude tests/server/load-suite.test.ts --exclude tests/integration/serial-flow.test.ts; then
11+ echo " ✅ Alle Tests bestanden"
12+ else
1213 echo " ❌ Fehler: Die schnellen Tests sind fehlgeschlagen!"
1314 echo " → Tests reparieren, dann erneut pushen."
1415 exit 1
1718# 2. SonarQube Integration (optional - nur wenn Token gesetzt)
1819if [ -n " $SONAR_TOKEN " ]; then
1920 echo " 📡 Starte SonarQube Scan..."
20- sonar-scanner -Dsonar.token=$SONAR_TOKEN -Dsonar.qualitygate.wait=false
21- if [ $? -ne 0 ]; then
21+ # Wrap in if-condition to prevent sh -e from exiting on scanner failure (non-blocking)
22+ if sonar-scanner -Dsonar.token=" $SONAR_TOKEN " -Dsonar.qualitygate.wait=false; then
23+ echo " ✅ SonarQube Scan abgeschlossen"
24+ else
2225 echo " ⚠️ Warnung: SonarQube Scan fehlgeschlagen (nicht blockierend)"
23- # Nicht mit exit 1 abbrechen - SonarQube Fehler sollten Push nicht blockieren
2426 fi
2527else
26- echo " 💡 Tipp: Um SonarQube zu aktivieren, setzen Sie: export SONAR_TOKEN= \" <token> \" "
28+ echo " ℹ️ Kein SONAR_TOKEN gesetzt — SonarQube Scan übersprungen "
2729fi
2830
2931echo " ✅ Pre-Push Checks abgeschlossen. Push wird fortgesetzt..."
You can’t perform that action at this time.
0 commit comments