2

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.

Bhanu
  • 831
  • 3
  • 13
  • 28

3 Answers3

2

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
G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
1

Mibex Software's excellent free Sonar for Bamboo has evolved to be the canonical (and supported) SonarQube integration for Bamboo - it provides a Bamboo tasks to analyze projects with Sonar for Maven, Gradle & SonarRunner and also supports auto-branching for Sonar-based code reviews-

Steffen Opel
  • 63,899
  • 11
  • 192
  • 211
0

The bamboo server has Sonar Runner task that can be used to execute the code. You need to have sonar-project.properties file in your root folder.

The settings that need to be done are:

sonar.projectKey=<projectkey>
sonar.projectName=<projectname>
sonar.projectVersion=1.0.0
sonar.sourceEncoding=UTF-8
# Enable the Visual Studio bootstrapper
sonar.visualstudio.enable=true
# Code Coverage
#placeholder-for-modular-coverage-reporting
# Unit Test Results
#placeholder-for-modular-unit-test-reporting
# Required only when using SonarQube < 4.2
sonar.language=cs
# FXCop
# This property is set because it is required by the SonarQube Runner.
# But it is not taken into account because the location of the source
# code is retrieved from the .sln and .csproj files.
sonar.sources=.
# If you have multiple solution files then use the current one by setting up the below property
sonar.visualstudio.outputPaths=
# Test projects can be imported as unit test code (which is not analyzed by coding rules) using the regular expression property
#sonar.visualstudio.testProjectPattern=
#sonar.visualstudio.solution=YourSolution.sln
sonar.visualstudio.skipIfNotBuilt=true

This Msbuild Sonar may be helpful for you.