Sonar Scanner для GitLab CI/CD.
- openjdk:11-jre-slim
- curl
- unzip
- git
- SONAR_SCANNER_VERSION="4.0.0.1744" - версия Sonar Scanner
stages:
- sonarqube
variables:
MAJOR: "10.3.1"
PATH_SRC: "src/"
sonarqube:
stage: sonarqube
image:
name: ${CI_REGISTRY}/devops/sonar-scanner-cli:latest
entrypoint: [""]
script:
- export PROJECT_VERSION="${MAJOR}.$(grep -oPm1 "(?<=<VERSION>)[^<]+" ${PATH_SRC}VERSION)"
- export SONAR_SCANNER_OPTS="-Xmx6g"
- sonar-scanner
-D"sonar.projectVersion=${PROJECT_VERSION}"
-D"sonar.login=${SONAR_LOGIN}"
only:
refs:
- develop
tags:
- docker
when: manual