Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .scripts/sonar-scan-frontend.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

if [ -z "$SONAR_TOKEN" ]; then
echo "Erro: A variável de ambiente SONAR_TOKEN não está definida."
echo "Uso: SONAR_TOKEN=<seu_token> $0"
exit 1
fi

SONAR_HOST_URL="${SONAR_HOST_URL:-http://localhost:9500}"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"

echo "Iniciando análise do SonarQube para o frontend (apps/apae)..."
echo "Servidor SonarQube: $SONAR_HOST_URL"

docker run --rm \
--network host \
-v "$ROOT_DIR/apps/apae:/usr/src" \
-e SONAR_HOST_URL="$SONAR_HOST_URL" \
-e SONAR_TOKEN="$SONAR_TOKEN" \
sonarsource/sonar-scanner-cli:11
Comment thread
JerfesonGregorio marked this conversation as resolved.
6 changes: 6 additions & 0 deletions apps/apae/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.projectKey=apae-geral-frontend
sonar.projectName=apae-geral-frontend
sonar.sources=src
sonar.exclusions=**/node_modules/**, **/.next/**, public/**, **/next-env.d.ts
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.sourceEncoding=UTF-8
Loading