Passing sonarqube report name from jenkins pipeline

Hi, I’m using Cloudbees Jenkins pipeline to streamline the process, Sonarqube included. However, we have multiple report from scanning UAT, OAT, Pre-Prod. All of them share the same name on Sonarqube thus the report may be overrided. I cannot revise our git repository to change the report name since all environment use the same git repository.

So, is there any method or clause I can use to pass different project name from Cloudbees Jenkins pipeline to avoid override issue?

Hey there.

You’ll need to either use a different project key (sonar.projectKey) for each branch, or as a different branch if you’re using at least SonarQube Developer Edition.

Thank you for your answer. Can you elaborate on “different branch”. We are using a shared repo to store sonarqube’s code, and it will read the sonarqube key from another repo. Do you mean to create replicate branches for the second repo?

Presumably, these are your separate branches, each of which you would need to provide a different project key for. Using Developer Edition or higher, you can pass a different value to while analyzing each branch in order to separate the reports.

Thank you!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.