Nirmesh
Nirmesh

Reputation: 305

Rest api to get sonarqube info from bamboo build or vice versa

Is there any way I can get any sonarqube api which can provide the build number of bamboo or any bamboo api which can give sonarqube info.This would really help.

I have so far tried both side but i am surprised both the system are quite clueless about each other. Why it is not possible that a build which ran sonarqube as as one of it's job doesn't have any information about that. Also neither in sonar it tell which build has actually triggered that sonar execution

Upvotes: 0

Views: 279

Answers (1)

Ian W
Ian W

Reputation: 4767

(Not sure I understand what exactly you are looking for, perhaps this ...? )

I don't believe you can relate a specific Activity (SonarQube analysis) to a specific build (Bamboo), just project to job.

You must have SonarQube Server configured in Bamboo

Bamboo Server SQ config - from https://marketplace.atlassian.com/apps/1212756/sonar-for-bamboo?hosting=server&tab=overview#

When executing your job, you can add these sonar.links optional parameters to the analysis step:

sonar.links.homepage Project home page.
sonar.links.ci Continuous integration.
and
sonar.links.scm Project source repository.
sonar.links.issue Issue tracker.

Maybe also specify sonar.host.url=$SONAR_HOST_URL (where SONAR_HOST_URL is the global setting in Bamboo) in the analysis step parameters.

Those populate the Project Overview page sidebar:

SonarQube Sidebar

That should provide the links from SonarQube back to the other systems of interest.

If you have properly configured Bamboo, you should see a link in Bamboo to the SonarQube project, post execution.

Bamboo Job - from https://marketplace-cdn.atlassian.com/files/images/16bd8e48-dbaf-470a-8855-1dc880388734.png

Upvotes: 1

Related Questions