I’m using sonar-gitlab-plugin 3.0.2 with SonarQube 6.7.7 to prevent bad codes from being merged. When the job is triggered, 2 Gitlab pipelines start running, one I can see the log that simply running some sort of check on a Gitlab docker which scans literally nothing. The other is an external job that hangs there forever without any sort of log coming out. How can I make the pipelines run properly? Thanks. Below is gitlab-ci.yml
.
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
variables:
SONAR_TOKEN: "SONARQUBE_TOKEN"
SONAR_HOST_URL: "SONARQUBE_DOMAIN"
GIT_DEPTH: 0
sonarqube-check:
stage: test
script:
- sonar-scanner
-Dsonar.qualitygate.wait=true
-Dsonar.host.url=SONARQUBE_DOMAIN
-Dsonar.login=SONARQUBE_TOKEN
-Dsonar.gitlab.user_token=GITLAB_USER_TOKEN_WITH_QUOTES
-Dsonar.gitlab.project_id=$CI_PROJECT_PATH
-Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
-Dsonar.analysis.mode=preview
allow_failure: false
only:
- merge_requests
- staging