Steps necessary to get Include Code Quality for Bamboo up and running.
Excerpt |
---|
|
Info |
---|
SonarQube™ scanners need access to the full git repository. If you encounter issues, e.g. in a containerized build, ensure that you uncheck "Use shallow clones" option (Fetches the shallowest commit history possible. Do not use if your build depends on full repository history) check "Fetch whole repository" option (Fetches whole repository instead of only one branch)
|
|
1. | Latest Include Code Quality for Bamboo supports SonarQube™: |
2. | Install Include Code Quality for Bamboo app on your Bamboo server |
3. | Setup the SonarQube™ server configuration (Bamboo Administration > Apps > Include Code Quality for Bamboo ): Image Modified |
4. | Add a task to your build plan Select type compatible to your build tool For the Sonar™ Scanner task types, you need to install the scanners separately on Bamboo server or use the provided Docker images instead.
Image Modified |
5. | Select SonarQube™ server configuration Select one of the configured servers from Step 3 above Image Modified(Alternative) From environment variables or build files Set the correct SonarQube™ Edition of your server Image Modified
|
| SonarQube™ Community Edition | SonarQube™ Developer Edition or higher, SonarCloud™ |
---|
6. | Info |
---|
The SonarQube™ Community Edition does not know about branches and pull requests. A separate SonarQube™ project for each branch is used to show SonarQube™ information for pull requests and branches. Include Code Quality for Bamboo uses Sonar™ project keys in the format <projectKey>:<branchName> More details can be found in our Sonar™ Analysis Configuration guide |
Include Code Quality for Bamboo replaces characters in the <branchName> part that are not allowed in SonarQube™ project keys. A dash - is used by default. You can override the replacement character: Image ModifiedYou can disable the automatic SonarQube™ project creation by selecting “Disable … per branch creation”. Every time the task runs, the analysis result will add analysis to the same SonarQube™ project. Image Modified | Use Pull Request Analysisif your build plan is triggered by a pull request. - Image Modified
This setting work best if Bamboo is used with Bitbucket and branch plans are created automatically. Set “When pull request is created” as plan branch creation trigger in Bamboo to enable automatic branch creation.
Image Modified2. Use Branch Analysisif you are not using pull requests. Image Modified3. If you migrated SonarQube™ from Community to Developer Edition or higher, you can keep the “project per branch” style by checking the “Create … Project per Branch” option. |
7. | Trigger a new build of your build plan and you should see the SonarQube™ Quality gate status on the build results page: Image ModifiedTo break the build when the Sonar Quality™ Gates are failing, enable the option Show and break build on broken quality gates in the task's configuration: Image Modified |
8. (optional) | If your project takes too long to analyze for short-living branches like feature branches, consider using incremental mode to only analyze the changed/new files in your pull requests instead of the complete project: |
Image RemovedImage Added |
9. | Congratulation, you finished the Include Code Quality for Bamboo setup. Need support? Please contact us, we at Mibex Software are happy to help you. |