add jenkins file for sonar

This commit is contained in:
gun kaewngarm 2024-07-13 15:44:03 -04:00
parent bc0e14b033
commit 217bfcc297

16
Jenkinsfile vendored
View file

@ -1,10 +1,26 @@
pipeline {
agent any
environment {
SCANNER_HOME=tool 'sonar-scanner'
}
stages {
stage('Stage 1') {
steps {
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 '''
}
}
}
}
}