user1338413
user1338413

Reputation: 2551

The workflow of jenkins and sonar with the database

i have installed sonar, jenkins and the sonar jenkins plugin.

on a working projekt I added sonar as a post build action. Now when i start the job, it fails with:

"The current batch process and the configured remote server do not share the same DB configuration"

I found 2 possible reasons for this:

1. The database URL on the batch and the server side don’t match
2. There are two Sonar servers using this database. 

I checked the 1. reason and the url are correct, so it might be the 2. rason.

I started sonar over the shell at the same time the job on jenkins was going on. But didnt work further with it. So my questions:

1. When I start sonar over the shell(so I can browse to localhost:9000) does it automatically work with the database? 

That would make sense to me, but does it meant that

I cant use sonar on his own (when jenkins uses it)? and that

Jenkins starts sonar automatically when he needs it?

Im pretty new with this, so trying to understand the workflow..

Upvotes: 0

Views: 1167

Answers (1)

Mark O'Connor
Mark O'Connor

Reputation: 77991

In that case you're asking two questions. Sonar is a stand-alone server separate to Jenkins. It can be started from the command-line, as you've discovered.

By default Sonar will startup it's own webserver and run with an embedded database. It is normal to configure Sonar to connect to a more permanent database like MySQL (other options).

The Jenkins plug-in runs the client-side part of Sonar. These are the actual source code analysis tools which scan your build's source code. At the end of the analysis run, source code metrics are loaded directly into Sonar's database (From Jenkins which is why you need to configure the DB credentials).

Upvotes: 1

Related Questions