This is an old revision of the document!
SonarQube is an open-source platform for static code analysis, used to verify the technical quality of the source code. The development is managed by sonarsource (Tool website: sonarqube.org). The tool was released in 2007 and was called “Sonar” until the name was changed in 2013.
Homepage: https://www.sonarqube.org/
Doc: https://docs.sonarqube.org/latest/analysis/gitlab-integration/
Save the group access token
sonar.projectKey=<project-name>_<key from sonarqube> sonar.qualitygate.wait=false sonar.python.version=2
stages: - sonarqube sonarqube_check_job: only: refs: - tags variables: - $CI_COMMIT_TAG =~ /^[Cc]heck_source-.*$/ # commit tag starts job image: name: sonarsource/sonar-scanner-cli:latest entrypoint: [""] tags: - sonarqube-runner stage: sonarqube variables: SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task cache: key: "${CI_JOB_NAME}" paths: - .sonar/cache script: - sonar-scanner -Dproject.settings=.sonar-project.properties # -X = debug, only for tests if failed allow_failure: true