Sonarqube integration with CircleCI

Must-share information (formatted with Markdown):

  • We are using CE 10.0 and deployed in GKE cluster using helm chart.

  • Trying to integrate the sonarqube scan step in circleCI workflow.

  • what have you tried so far to achieve this

As per the instructions here CircleCI Developer Hub - sonarsource/sonarcloud
we have imported sonarsource orb ** sonarcloud: sonarsource/sonarcloud@2.0.0** in circleCI workflow and the required config.

but the pipeline is failing with below error message.

ERROR: Error during SonarScanner execution ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator

Also per doc instructions I have created the SONAR_TOKEN with Execute Analysis permission on the project in sonarqube.

Please let me know if anything else required from my side for further help.

Thanks in advance.

Hey there.

SonarQube won’t return this error message – but SonarCloud will! And indeed, it looks like you’re using CircleCI Developer Hub - sonarsource/sonarcloud

To be honest, I don’t know why there’s not a native integration with CircleCI and SonarQube like there is with SonarCloud. However, you should at least be able to follow the “Other CI” tutorial in the SonarQube UI after creating your project to get started.