Several .net Core builds into one Sonar Project

dotnet

(Jörg Lang) #1

Hi there,
we are quite new to SonarQube Developer Edition and we have followeing issue:

We have a software project, which is diveded into several (for example 4) micro services, writte in .net core.
Each micro service has to be build seperately so I have also 4 analysis.
How can I put all analysis togehter into one single SonarQube Project?
Thanks
Jörg


(Amaury Levé) #2

Hi @Joerg.Lang,

If you are building the different solutions on the same machine you can actually do:

  1. scanner begin
  2. build solution 1
  3. build solution 2
  4. build solution 3
  5. build solution 4
  6. scanner end

If you do have different build machines or you require different Quality Profile then you don’t have such options (except if you can upgrade to the Enterprise Edition and use the Portfolio system).

Cheers,
Amaury


(Jörg Lang) #3

Hi Amaury,
thanks for your answer. That was really helpfull and it will work if I build all solutions in one single build job.

Is it also possible to “merge” the result auf two scanns that are runnung in two different jobs?
So
Day :

  1. Scanner Begin
  2. build solution 1
  3. scanner end
    Day 2
  4. Scanner Begin
  5. build solution 2
  6. scanner end

As for example because

  • solution 1 needs to be build today, because auf a pull request
  • solution 2 will be build tomorrow because of another pull request

Thnaks
Jörg


(Amaury Levé) #4

We think that for such use case it’s better to have multiple SonarQube projects because even if you decide to release the parts all together they have a different lifecycle and so it’s better for them to have different Quality Gate.

(just in case my answer was not clear, the answer to the question can you merge is no :slight_smile: )

Cheers,
Amaury


(Jörg Lang) #5

thanks again Amaury.
We observerd already that having several Sonar Projects seams to be required when haben different technologys (fe .net c# and JavaScript) oder different microservices analyzed withour overwrite something
Thanks for your help