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