Skip to content

Commit 8d55086

Browse files
authored
PHP版本扫描
1 parent a3ce521 commit 8d55086

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/org/devops/sonarqube.groovy

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
package org.devops
22

3-
def SonarScan(projectName,)
3+
def SonarScan(projectName,projectDesc,projectPath){
4+
withSonarQubeEnv(credentialsId: 'SonaerServer-Admin') {
5+
def scannerHome = "/usr/local/sonar-scanner"
6+
def sonarDate = sh returnStdout: true, script: 'date +%Y%m%d%H%M%S'
7+
sonarDate = sonarDate - "\n"
8+
9+
10+
sh """
11+
${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=${projectName} \
12+
-Dsonar.projectName=${projectName} \
13+
-Dsonar.projectVersion=${sonarDate} \
14+
-Dsonar.ws.timeout=30 \
15+
-Dsonar.projectDescription=${projectDesc} \
16+
-Dsonar.language=php \
17+
-Dsonar.dynamicAnalysis=false \
18+
-Dsonar.sourceEncoding=UTF-8
19+
"""
20+
}
21+
}

0 commit comments

Comments
 (0)