Last active
March 28, 2023 07:25
-
-
Save taufiqpsumarna/fd8b4fe771831bf1b371a015da286750 to your computer and use it in GitHub Desktop.
Code snippet sonarqube with jenkinsfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
stages { | |
// Sonarqube Analysis | |
// Abort pipeline if QualityGate fail timeout 10 minutes | |
stage('SonarQube Analysis 🔬') { | |
environment { | |
scannerHome = tool 'SonarQubeScanner' //Make sure to replace SonarScanner with the name you gave to your SonarQube Scanner tool in Jenkins | |
} | |
steps { | |
withSonarQubeEnv('sonarqube') { | |
sh "${scannerHome}/bin/sonar-scanner" | |
} | |
timeout(time: 10, unit: 'MINUTES') { | |
waitForQualityGate abortPipeline: true | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Snippet Jenkinsfile for running sonarqube analysis