This orb runs SonarScanner CLI in CircleCI workflows to analyze projects with SonarQube Cloud.
Learn more about SonarQube Cloud.
The SonarQube Cloud Orb can be used with any Linux-based Docker image that includes the command-line tools curl and unzip.
The orb supports Linux x64 and ARM64 executors.
- To connect to your SonarQube Cloud project, you need to set up an API token. We recommend setting up a CircleCI context in your organization named
sonarcloudthat contains a variable with the keySONAR_TOKENand the API token as the value. - To connect to a region other than the default EU region, you need to pass the
sonar.regionparameter to the scanner. For this, we recommend adding theSONAR_REGIONenvironment variable to your CircleCI context with the value of the region.
| Region | URL | SONAR_REGION value |
Minimum SonarScanner CLI version |
|---|---|---|---|
| EU | sonarcloud.io |
(not set) | Any |
| US | sonarqube.us |
US |
7.1.0.4889 |
| AU | sonarqube.au |
AU |
8.4.0.16527 |
The orb uses a default SonarScanner CLI version that supports all regions. If you override the scanner_version parameter, make sure you use a version that supports your region.
See files in the examples directory for examples of how to use the orb.
To publish a new version of the orb, you need to change the version found in .circleci/config.yml to the new version. The CircleCI build pipeline will then publish the new version of the orb.
See https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/scanner-environment