1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

fix(sonar): disable gcp upload when not configured (#3369)

This commit is contained in:
Siarhei Pazdniakou
2021-12-15 18:25:46 +03:00
committed by GitHub
parent cd243ee542
commit 91ddbf9152
5 changed files with 20 additions and 0 deletions

View File

@@ -55,6 +55,10 @@ type sonarExecuteScanReports struct {
}
func (p *sonarExecuteScanReports) persist(stepConfig sonarExecuteScanOptions) {
if GeneralConfig.GCSBucketId == "" {
log.Entry().Info("persisting reports to GCS is disabled, because gcsBucketId is empty")
return
}
content := []gcs.ReportOutputParam{
{FilePattern: "sonarscan.json", ParamRef: "", StepResultType: "sonarqube"},
{FilePattern: "sonarExecuteScan_*.json", ParamRef: "", StepResultType: "sonarqube"},