Support for SonarScanner CLI in CircleCI
The SonarQube Cloud Orb can be used with any Linux-based Docker image that includes the command-line tools curl
and unzip
.
- To connect to your SonarQube Cloud project on
sonarcloud.io
, you need to set up an API token. We recommend setting up a CircleCI context in your organization namedsonarcloud
that contains a variable with the keySONAR_TOKEN
and the API token as the value.
- To connect to your SonarQube Cloud project in the US region,
sonarqube.us
, you need to pass thesonar.region=US
parameter to the scanner. For this, we recommend adding theSONAR_REGION
environment variable to your CircleCI context with the valueUS
. - To set up the API token, the recommendation is the same as for the EU 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.sonarcloud.io/appendices/scanner-environment/