Skip to main content
Version: 3.11-dev

Sonarqube Project Properties for Application

The KubeRocketCI platform simplifies this process by supporting SonarQube integration with predefined configurations. However, specific use cases may require customization. Below is a guide on setting the SonarQube project properties to meet all application requirements.

Application repo structure​

When an application is added to the KubeRocketCI, a default sonar-project.properties file is automatically generated during the codebase onboarding process. However, depending on the specific needs of the application, a separate configuration file can be created, placed in the root directory of the application repository, and used for sonarqube code quality during the pipeline:

example repository structure
go-example-project
β”œβ”€β”€ deploy-templates
β”‚ └── ..
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ Makefile
β”œβ”€β”€ controllers
β”‚ β”œβ”€β”€ hello.go
β”‚ └── hello_test.go
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
β”œβ”€β”€ main.go
β”œβ”€β”€ routers
β”‚ └── router.go
└── sonar-project.properties

Default project parameters​

  • sonar.projectKey: A unique identifier for the SonarQube project. This is also set to the application codebase name by the KubeRocketCI pipelines.

  • sonar.projectName: A readable name for the project. This is also set to the application codebase name by the KubeRocketCI pipelines.

  • sonar.qualitygate.wait: Enables waiting for Quality Gate results before proceeding (e.g., true or false) by default KubeRocketCI pipelines set it true.

  • sonar.host.url: by default set from KuberocketCI pipelines from KuberocketCI sonarqube integration url.

  • sonar.login: by default set from KuberocketCI pipelines from KuberocketCI sonarqube integration token.

  • sonar.organization: by default not set from KuberocketCI pipelines and used only for sonar cloud integration.

    sonar-project.properties: file example of configuration
    sonar.projectKey=go-example-project
    sonar.projectName=go-example-project
    sonar.exclusions=**/cmd/**,**/deploy/**,**/deploy-templates/**,**/*.groovy,**/config/**
    sonar.language=go

For additional assistance with configuring SonarQube properties, please refer to the SonarQube documentation