Hello,
we are using SonarQube 10.0.0.68432.
We have already integrated it successfully to mulitple piplines in our Azure DevOps OnPremise installation and it works perfectly. We got one issue/questions around running the sonarsource/sonar-scanner-cli docker image for one pipeline, where we can not do the analysis locally (due to issues with the required node version for typescript). The issue we are fighting with is branch detection and PR decoration. It seems that we are missing how to pass the data generated by the SonarQubePrepare@5 task to the docker image running the analysis.
What we do:
We run the SonarQubePrepare@5 task and from logs it detects the branch/PR properly.
Next we run the docker image from commandline like this:
task: PowerShell@2
displayName: Run SonarQube Scanner
inputs:
targetType: inline
script: |
docker run `
--rm `
--user="$(id -u):$(id -g)" `
-e SONAR_HOST_URL="<url>" `
-e SONAR_SCANNER_OPTS="-Dsonar.projectKey=TDWV" `
-e SONAR_TOKEN="<our token>" `
-v $(build.SourcesDirectory):/usr/src `
-v sonar-scanner-cache:/opt/sonar-scanner/.sonar/cache `
sonarsource/sonar-scanner-cli
condition: succeeded()
Finally we run:
- task: SonarQubePublish@5
inputs:
pollingTimeoutSec: '300'
The analysis succeeds, but is always sent without branch/PR information to SQ.
What is the proper way to share the results of SonarQubePrepare@5 task to the docker image? Mount another disk? But where is the output of SonarQubePrepare@5 saved to? Or do we need to pass all parameters manually to the image?
Any information we can share further to support the analysis?
Thanks!