Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Configuration

  1. Configure the Sonar™Scanner as described in the SonarQube™ Wiki.

    1. See the official Sonar™Scanner example projects for inspiration

  2. Add a Sonar™ Scanner task to your Bamboo job

  3. For test coverage in SonarQube™ with Sonar™Scanner, please pass the required parameters to specify the path to the coverage reports as described in the SonarQube™ Wiki.

...

  1. Define a remote agent capability for the Sonar™Scanner CLI Docker image:

    1. Go to Bamboo > Agents > Shared Remote Capabilities

    2. Create a new capability of type Custom with key docker-sq-scanner and value /opt/sonar-scanner

      Image RemovedImage Added
    3. Create a new Bamboo job for the SonarQube™ analysis and use the Docker image sonarsource/sonar-scanner-cli:latest:

      Image RemovedImage Added

      d. Add the Sonar™Scanner task configuration, and choose for the field SonarQube™Scanner executable the value docker-sq-scanner

      Image RemovedImage Added
    4. Run the Bamboo job, and the analysis should work fine.

    5. If you experience any errors like JGit Failed to find all committed files , make sure you follow the troubleshooting advice below.

...

Info

Remote Agents

If you use SonarScanner task on a remote agent, set the capability by either

a) adding a SonarScanner capability to your remote agent in the Bamboo UI, see above

b) or add the following key/value pair to your bamboo-agent-home/bin/bamboo-capabilities.properties file, see Bamboo docs for more details:

  • Code Block
    system.builder.sos.SonarScanner=/path/to/your/sonarqube-scanner/home

...