Skip to content

Using Sonarqube Community Branch plugin

The Sonarqube community edition, doesn't support analyzing branch or pull request.

However, there is a plugin to support branch analysis for Sonarqube community version.

To install this plugin, you need to download the compatiablity version plugin for the Sonarqube you installed, take Docker version 8.9.10 as example.

For docker version installation please refer to this guide.

  • Download the plugin version 1.8.3, and save into /var/lib/docker/volumes/sonarqube_extensions/_data/plugins
  • Remove the existing running container by running docker rm -f sonarqube
  • Restart the container with command like

    Bash
    sudo docker run -d --name sonarqube \
        --link postgres:postgres \
        -p 9000:9000 \
        -e SONAR_JDBC_URL=jdbc:postgresql://postgres/sonarqube?currentSchema=public \
        -e SONAR_JDBC_USERNAME=<pg user> \
        -e SONAR_JDBC_PASSWORD=<pg pass> \
        -e SONAR_WEB_JAVAADDITIONALOPTS=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.8.3.jar=web \
        -e SONAR_CE_JAVAADDITIONALOPTS=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-1.8.3.jar=ce \
        -v sonarqube_data:/opt/sonarqube/data \
        -v sonarqube_extensions:/opt/sonarqube/extensions \
        -v sonarqube_logs:/opt/sonarqube/logs \
        sonarqube:lts
    

For more details please refer to the plugin site.