You've already forked sap-jenkins-library
							
							
				mirror of
				https://github.com/SAP/jenkins-library.git
				synced 2025-10-30 23:57:50 +02:00 
			
		
		
		
	fix(sonar): archive result file via handleStepResults (#4227)
* Update sonarExecuteScan.groovy * Update sonarExecuteScan.go
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							1e242a7fd6
						
					
				
				
					commit
					31ee45ad30
				
			| @@ -195,6 +195,13 @@ func runSonar(config sonarExecuteScanOptions, client piperhttp.Downloader, runne | ||||
| 		log.Entry().WithError(err).Warning("no scan report found") | ||||
| 		return nil | ||||
| 	} | ||||
| 	// write reports JSON | ||||
| 	reports := []piperutils.Path{ | ||||
| 		{ | ||||
| 			Target:    "sonarscan.json", | ||||
| 			Mandatory: false, | ||||
| 		}, | ||||
| 	} | ||||
| 	// write links JSON | ||||
| 	links := []piperutils.Path{ | ||||
| 		{ | ||||
| @@ -202,7 +209,7 @@ func runSonar(config sonarExecuteScanOptions, client piperhttp.Downloader, runne | ||||
| 			Name:   "Sonar Web UI", | ||||
| 		}, | ||||
| 	} | ||||
| 	piperutils.PersistReportsAndLinks("sonarExecuteScan", sonar.workingDir, utils, nil, links) | ||||
| 	piperutils.PersistReportsAndLinks("sonarExecuteScan", sonar.workingDir, utils, reports, links) | ||||
|  | ||||
| 	if len(config.Token) == 0 { | ||||
| 		log.Entry().Warn("no measurements are fetched due to missing credentials") | ||||
|   | ||||
| @@ -70,7 +70,6 @@ void call(Map parameters = [:]) { | ||||
|                                         withSonarQubeEnv(stepConfig.instance) { | ||||
|                                             echo "Instance is deprecated - please use serverUrl parameter to set URL to the Sonar backend." | ||||
|                                             sh "${piperGoPath} ${STEP_NAME}${customDefaultConfig}${customConfigArg}" | ||||
|                                             archiveArtifacts artifacts: "sonarscan.json", allowEmptyArchive: true | ||||
|                                             jenkinsUtils.handleStepResults(STEP_NAME, false, false) | ||||
|                                             readPipelineEnv(script: script, piperGoPath: piperGoPath) | ||||
|                                         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user