fix: Use actual container IPs for network communication
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Failing after 2m13s
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Failing after 2m13s
This commit is contained in:
@@ -13,31 +13,23 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# Docker 네트워크 내에서 접근
|
||||
repository: ${{ gitea.repository }}
|
||||
token: ${{ gitea.token }}
|
||||
run: |
|
||||
git clone http://172.17.0.2:3000/${{ gitea.repository }}.git .
|
||||
|
||||
- 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"
|
||||
|
||||
curl -f http://172.17.0.3:9000/api/system/ping || echo "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" \
|
||||
--network bridge \
|
||||
-e SONAR_HOST_URL="http://172.17.0.3:9000" \
|
||||
-e SONAR_SCANNER_OPTS="-Dsonar.projectKey=my-project" \
|
||||
-e SONAR_TOKEN="${SONAR_TOKEN}" \
|
||||
-v "${{ github.workspace }}:/usr/src" \
|
||||
-v "$(pwd):/usr/src" \
|
||||
sonarsource/sonar-scanner-cli
|
||||
Reference in New Issue
Block a user