SonarQube (Commercial) + on-prem git repository

Hi everyone,

I would like to ask if it would be possible to connect SonarQube (Enterprise / Developer) on an on-prem git repository since the company do not use any public/private git repositories available online such as github, gitlab, etc.

Would this current set up be viable to run analysis?

  • Push code to on prem git repository
  • TeamCity builds and use SonarQube scanner to analyse the code using a script
  • Upload to SonarQube server / database

However, if we wanted to use the PR analysis for an on prem git repository, would we be able to do so? Is it possible to hook it with SonarQube?

Thank you

Short answer: Yes.

We use Github Enterprise with Jenkins. Jenkins pipelines run the Sonarqube scanners which upload to the Sonarqube server. The docs are excellent with regard to setting this up.

Scanning on PR can be a little more complex as you have to get all the webhooks, etc correct. Again, the docs are helpful and the latest versions of Sonarqube are much simpler to configure.

Scanning on PR can be a little more complex as you have to get all the webhooks, etc correct. Again, the docs are helpful and the latest versions of Sonarqube are much simpler to configure.

From what I’ve seen the only ALM integrations that can be used are Github, Gitlab, AzureDevOps, and BitBucket, how are we going to be able to use PR decoration with our own git repository (meaning the company does not host it on these said git repos). With that being said, is it possible to implement PR decorations to an owned/on-premise hosted git repository, cause if not, I cannot see that the company will benefit to the feature of PR decoration.

Our Github is on-prem (Github Enterprise). If you’re talking about using Git without one of the major providers then PR decoration could be problematic. You’d need a way to post webhooks from your Git system to your CI system.

Hi Richard,

I see, yes exactly, we are not hosting it on any of the major providers, it’s our own hosted repository. That’s what I was been thinking as we need to create webhooks for it to send the results to the repository. I haven’t done any trials for commercial editions yet to look at it, and would probably hope if any of the sonar guys can answer this question.