Gitlab Docker container to run sonar-scanner. Publish results to sonarqube and/or Gitlab as comment
10K+
Add the next stage to your .gitlab-ci.yml.
stages:
- analysis
sonarqube:
stage: analysis
image: hiorgserver/gitlab-sonar-scanner
variables:
SONAR_URL: "http://your-gocd-server:9000"
SONAR_TOKEN: "$GITLAB_CI_SECRET_VAR_SONAR_TOKEN"
SONAR_PROJECT_KEY: "$CI_PROJECT_NAMESPACE:$CI_PROJECT_NAME"
SONAR_PROJECT_NAME: "$CI_PROJECT_NAME"
SONAR_BRANCH: "$CI_COMMIT_REF_NAME"
SONAR_PROJECT_VERSION: "$CI_JOB_ID"
SONAR_GITLAB_COMMENT: "true"
SONAR_PUBLISH: "true"
script:
- /usr/bin/sonar-scanner-run.sh
You should have analysed the project by hand before to create it in your sonarqube server.
Can be checked in the official documentation: https://docs.sonarqube.org/display/SONARQUBE43/Analysis+Parameters
Content type
Image
Digest
Size
69.4 MB
Last updated
over 8 years ago
docker pull hiorgserver/gitlab-sonar-scanner