Search code examples
iosjenkinssonarqubesonar-runnerjenkins-workflow

Sonar Runner OS X


I'm currently looking at how to start using SonarQube as part of a Jenkins build process for building mobile apps.

Because we are building mobile apps our Jenkins runs on OS X so we can support iOS.

We have a Sonar server running on a windows box elsewhere on the network so all we need to do from the OS X box is send the files that relate to the analysis.

What is the best way of doing that? Using the Sonar Runner jar? If so where is the best place to source that from?

EDIT

I should have added that we are using Jenkins Workflow in our build scripts, this means it isn't easy for us to use plugins that don't support the simple build step, as I believe Sonar doesn't.

This is why we really need information on how to do Sonar analysis from the command line.

EDIT

I appreciate that Sonar uses Java but I am definitely seeing different behaviour on OS X as opposed to Windows.

On Windows the Sonar Runner script works, whereas on OS X it times out, I'm able to verify it isn't a network issue since I can get to the Sonar server though the browser.


Solution

  • Regarding the OS, it's all Java code, so OS is a non-issue.

    Regarding using Jenkins, take a look at SonarQube Scanner for Jenkins. It will let you configure your server information and add analysis as a Build Step to a job.

    Short of that, you can run an analysis from the command line by installing SonarQube Scanner, cd-ing to your project root and invoking sonar-runner.