bchsonarqube

Get started with SonarQube

NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:

 $ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."

The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.

The SonarQube installation folder has the following contents:

NOTE: Depending on your installation type, the SonarQube installation folder will be located in the following paths:

  • Approach A (Bitnami installations using system packages): /opt/bitnami/sonarqube

  • Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/sonarqube/sonarqube

Directory Content
bin/ SonarQube’s binaries.
conf/ SonarQube’s configuration files.
data/ SonarQube’s data.

Analyze your first project with SonarQube Scanner

To get started with the Bitnami SonarQube Stack and SonarQube Scanner, you can follow this two-minute quickstart guide to analyze a sample project:

  • Download the SonarQube Scanner zip file. You can find it for all platforms on this link.

  • Unzip it in /opt:

      $ sudo unzip -d /opt sonar-scanner-cli-*.zip
    
  • Download some sample projects from this link.

  • Unzip them in $HOME/sonar-scanning-examples:

      $ unzip -d $HOME master.zip
    
  • Analyze a project as shown below. Replace the USERNAME and PASSWORD placeholders with the correct user name and password.

      $ cd $HOME/sonar-scanning-examples/sonarqube-scanner
      $ /opt/sonar-scanner-*/bin/sonar-scanner -Dsonar.login=USERNAME -Dsonar.password=PASSWORD
    
  • Browse to http://SERVER-IP to find out the results. (SERVER-IP is a placeholder. Please, replace it with the actual domain of your SonarQube server).

You can find more information about SonarQube Scanner at SonarQube’s official documentation.

Last modification July 14, 2021