Files
TK-BOM-Project/.gitea/workflows/sonarqube.yml
Hyungi Ahn 4439c88d00
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Failing after 33s
fix: Update checkout configuration for Docker network
2025-07-24 12:19:33 +09:00

43 lines
1.2 KiB
YAML

name: SonarQube Analysis
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master ]
jobs:
sonarqube:
name: SonarQube Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Docker 네트워크 내에서 접근
repository: ${{ gitea.repository }}
token: ${{ gitea.token }}
- name: Test SonarQube connection
run: |
echo "Testing connection to SonarQube..."
curl -f http://192.168.1.100:9000/api/system/ping || echo "External connection failed"
- name: Run SonarQube scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: |
# Docker 네트워크 확인
docker network ls
# SonarScanner 실행
docker run \
--rm \
--network gitea_default \
-e SONAR_HOST_URL="${SONAR_HOST_URL}" \
-e SONAR_SCANNER_OPTS="-Dsonar.projectKey=TK-BOM-Project" \
-e SONAR_TOKEN="${SONAR_TOKEN}" \
-v "${{ github.workspace }}:/usr/src" \
sonarsource/sonar-scanner-cli