Execute SonarQube Scanner within Jenkins 2 Pipeline

后端 未结 3 769
花落未央
花落未央 2020-12-10 09:12

I want to execute a \"SonarQube Scanner\" Step within my Jenkins 2.x Pipeline.

When I try to create a sample groovy within the pipeline-syntax I only get a groovy sc

3条回答
  •  旧时难觅i
    2020-12-10 09:41

    env.sonarHome= tool name: 'scanner-2.4', type: 'hudson.plugins.sonar.SonarRunnerInstallation'
    
    withSonarQubeEnv('sonar.installation') { // from SonarQube servers > name
      sh "${sonarHome}/bin/sonar-runner -Dsonar.host.url=${SONAR_HOST_URL}  -Dsonar.login=${SONAR_AUTH_TOKEN}    -Dsonar.projectName=xxx -Dsonar.projectVersion=xxx -Dsonar.projectKey=xxx -Dsonar.sources=."
    
    }
    

提交回复
热议问题