Skip to content

ElectroStar/Sonar-Scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

Sonarqube-Scanner

Docker Image for Sonarqube-Scanner CLI

Supported tags and respective Dockerfile links

Quick reference

How to use this Image

To use this Image with Gitlab-CI for Sonarqube Codechecking with installed Gitlab-Plugin for reporting, use the following commands in a .gitlab-ci.yml - File:

variables:
  SONAR_URL: "http://YOUR-SONAR-Server/"
  
stages:
  - test

sonarqube_preview:
  stage: test
  image: electrostar/sonar-scanner:latest
  script:
    - git checkout origin/master
    - git merge $CI_COMMIT_SHA --no-commit --no-ff
    - sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.sources="." -Dsonar.projectKey="${CI_PROJECT_NAME}_${CI_PROJECT_ID}" -Dsonar.projectName="$CI_PROJECT_NAME" -Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME  -Dsonar.projectDescription="$CI_PROJECT_NAMESPACE"
  except:
    - develop
    - master
    - /^hotfix_.*$/
    - /.*-hotfix$/

sonarqube:
  stage: test
  image: electrostar/sonar-scanner:latest
  script:
  - sonar-scanner -Dsonar.host.url=$SONAR_URL -Dsonar.sources="." -Dsonar.projectKey="${CI_PROJECT_NAME}_${CI_PROJECT_ID}" -Dsonar.projectName="$CI_PROJECT_NAME" -Dsonar.projectDescription="$CI_PROJECT_NAMESPACE"
  only:
    - master

Just replace YOUR-SONAR-SERVER with the IP-Address of your Sonar-Server of your choice.

License

The Dockerfiles and associated scripts are licensed under the MIT License.

About

Docker Image for Sonarqube-Scanner CLI

Resources

License

Stars

Watchers

Forks

Packages

No packages published