Skip to content

Commit

Permalink
feat: add SonarQube analysis stage to Jenkinsfile for code quality ch…
Browse files Browse the repository at this point in the history
…ecks
  • Loading branch information
Ganthepro committed Dec 29, 2024
1 parent 68f5e4d commit 47850ab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ pipeline {
}

stages {
stage('SonarQube Analysis') {
steps {
script {
scannerHome = tool 'sonarqube-scanner'// must match the name of an actual scanner installation directory on your Jenkins build agent
}
withSonarQubeEnv('sonarqube-server') {// If you have configured more than one global server connection, you can specify its name as configured in Jenkins
sh "${scannerHome}/bin/sonar-scanner \
-Dsonar.organization=ganthepro \
-Dsonar.projectKey=ganthepro_edusaig \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarcloud.io"
}
}
}

stage('Build') {
steps {
script {
Expand Down

0 comments on commit 47850ab

Please sign in to comment.