Hi,
We use recently Sonar in Gitlab CI/CD and runs Sonar are become very slow.
For example, if I get source code of my project and execute the cmd “mvn verify sonar:sonar “-Dsonar.projectKey=****” “-Dsonar.qualitygate.wait=true”” directly on the project root, it’s take 1m20. If I execute the same command on the pipeline gitlab, it’s take 4m30…
In first time, I thought that the problem is due to cache, so i disabled it in the gitlab-ci.yml. But after an other run in gitlab, the time of pipeline is 3m. I don’t think this method is good.
For info, gitlab runners and SonarQube Server are on the same VM.
Gitlab-ci.yml
sonarqube-check:
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
GIT_DEPTH: "0"
ARTIFACT_COMPRESSION_LEVEL: "fast"
CACHE_COMPRESSION_LEVEL: "fastest"
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- mvn verify sonar:sonar "-Dsonar.projectKey=****" "-Dsonar.qualitygate.wait=true"
allow_failure: true
only:
- merge_requests
- master
- develop
- release
I added properties like ARTIFACT_COMPRESSION_LEVEL: “fast” and CACHE_COMPRESSION_LEVEL: “fastest” but I don’t have seen a good result.
We use Gitlab 14.3.2, GItlab runner 12.4.1 and SonarQube Entreprise 8.9.2.
Do you have any idea of the problem ?
Thanks for your help.