I need to run SonarQube for Go code using Jenkins. Unfortunately, there is little information regarding this task.
I have found that the "sonar-project.properties" file should be created, for example:
sonar.projectKey=com.company.projectkey1
sonar.projectName=My Project Name
sonar.sources=.
sonar.exclusions=**/*_test.go,**/vendor/**
sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.test.exclusions=**/vendor/**
But how to configure a Jenkins pipeline correctly? I found the following example, but I'm not sure if this is what I need
node {
stage('SCM') {
git '<my_path>.git'
}
stage('SonarQube analysis') {
def scannerHome = tool 'SonarScanner 4.0';
withSonarQubeEnv('My SonarQube Server') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
