Include Code Quality for Bitbucket never triggers a SonarQube™ analysis.
The most common scenario is an integration of the SonarQube™ analysis into your build pipeline.
...
The table shows the minimally necessary parameters to get Include Code Quality for Bitbucket to work with Sonar™Scanner. Look at the SonarQube™ documentation for additional parameters or different scanning methods.
Developer Edition or higher | Community Edition | SonarCloud™ https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/overview/ | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Common Parameters |
|
|
| |||||||||||||||||
Branch Analysis |
| Parameter not supported, branch included in Sonar™ project key as | See Developer Edition or higher | |||||||||||||||||
Pull Request Analysis |
|
See: https://docs.sonarqube.org/latest/analysis/pull-request/ |
| See Developer Edition or higher | |||||||||||
Only SonarQube™ 7.7 |
|
| Not needed |
---|
Build Systems
Bamboo
We provide a first class integration for Bamboo with our Include Code Quality for Bamboo plugin. See our dedicated wiki page for more information.
...
Use this Jenkinsfile
for inspiration:
...
:
...
Code Block | ||
---|---|---|
| ||
pipeline { agent any environment { scannerHome = tool name: 'scanner', type: 'hudson.plugins.sonar.SonarRunnerInstallation' } stages { stage('branch analysis') { when { not { changeRequest() } } steps { withSonarQubeEnv('sonar-cloud') { sh "${scannerHome}/bin/sonar-scanner -Dsonar.branch.name=${env.BRANCH_NAME}" } } } // NOT WORKING: https://issues.jenkins.io/browse/JENKINS-66581 stage('PR analysis') { when { changeRequest() } steps { withSonarQubeEnv('sonar-cloud') { sh "${scannerHome}/bin/sonar-scanner \ -Dsonar.pullrequest.key=${env.CHANGE_ID} \ -Dsonar.pullrequest.base=${env.CHANGE_TARGET} \ -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}" } } } } } |
...