mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 23:05:49 +00:00
add jenkins file for sonar
This commit is contained in:
parent
bc0e14b033
commit
217bfcc297
1 changed files with 16 additions and 0 deletions
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
|
@ -1,10 +1,26 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
SCANNER_HOME=tool 'sonar-scanner'
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Stage 1') {
|
stage('Stage 1') {
|
||||||
steps {
|
steps {
|
||||||
echo 'Hello world!'
|
echo 'Hello world!'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage("Sonarqube Analysis"){
|
||||||
|
steps{
|
||||||
|
withSonarQubeEnv('sonar-server') {
|
||||||
|
sh ''' $SCANNER_HOME/bin/sonar-scanner -Dsonar.projectName=Petclinic \
|
||||||
|
-Dsonar.java.binaries=. \
|
||||||
|
-Dsonar.projectKey=Petclinic '''
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue