Skip to content

Instantly share code, notes, and snippets.

@taufiqpsumarna
Last active March 28, 2023 07:25
Show Gist options
  • Save taufiqpsumarna/fd8b4fe771831bf1b371a015da286750 to your computer and use it in GitHub Desktop.
Save taufiqpsumarna/fd8b4fe771831bf1b371a015da286750 to your computer and use it in GitHub Desktop.
Code snippet sonarqube with jenkinsfile
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
}
}
}
}
}
@taufiqpsumarna
Copy link
Author

Code Snippet Jenkinsfile for running sonarqube analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment