How to execute SonarQube Runner from Bamboo?

Bhanu picture Bhanu · May 4, 2016 · Viewed 8.2k times · Source

I have setup SonarQube in Azure Virtual Machine.

sonarqube-5.4

MSBuild.SonarQube.Runner-2.0

SonarQube website at 9000 port is up and running.

(http://something.regionname.cloudapp.azure.com:9000/)

Now, how to execute sonarrunner from a local bamboo build server ?

What are the configuration settings and other changes ?

Earlier, I did setup sonarqube with bamboo locally successfully, because all are local paths.

But now, I want to install sonarqube and bamboo on different servers. How to connect these two ?

Please provide comments / settings in detail.

Thanks

Bhanu.

Answer

G. Ann - SonarSource Team picture G. Ann - SonarSource Team · May 4, 2016

There's a Bamboo plugin for that: https://marketplace.atlassian.com/plugins/com.marvelution.bamboo.plugins.sonar.tasks/server/overview

I haven't used it, and I don't know whether it supports SonarQube Scanner for MSBuild (I'm skeptical on that count.)

Perhaps your best bet is to treat Bamboo like a fancy CLI, and use follow the instructions for analyzing from the command line. I.E.

  1. install an configure SonarQube Scanner for MSBuild on the Bamboo server
  2. via Bamboo run commands:
    1. MSBuild.SonarQube.Runner.exe begin /k:"sonarqube_project_key" /n:"sonarqube_project_name" /v:"sonarqube_project_version"
    2. build the project
    3. MSBuild.SonarQube.Runner.exe end