You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stages {
stage('Checkout') {
steps {
readCommit() // Git commit message is read to check if a feature branch is requesting for adhoc sonar analysis
mavenCheckoutVerify() // Checkout Gerrit Project's patch set; pipeline triggered via Jenkins Gerrit Trigger Plugin
isSonarDisabled() // DB is queried to check if Sonar is Enabled for the project or not.
sonarOnFeatureBranch() // DB is queried to check if Sonar is Enabled for the project's feature branches or not.
}
}
stage('Test') {
steps {
mavenTest() // Runs mvn test command
}
}
stage('Sonar Analysis') {
when {
expression { return (!SONAR_DISABLED) && ((ADHOC_SONAR) || (SONAR_ON_FB) || (GERRIT_BRANCH =~ 'release') || (GERRIT_BRANCH == 'integration')) }
}
steps {
mavenSonar() // Runs Sonar Analysis and JaCoCo Report is uploaded to Sonar Server. Jenkins Sonar-Scanner Plugin is used and Sonar Server is configured for it to work.
}
}
stage('Quality Gate'){
when {
expression { return (!SONAR_DISABLED) && ((ADHOC_SONAR) || (SONAR_ON_FB) || (GERRIT_BRANCH =~ 'release') || (GERRIT_BRANCH == 'integration')) }
}
steps {
checkQualityGate() // Sonar-Scanner Plugin's withSonarQubeEnv ensures that Task-ID for Sonar Analysis is stored and SonarQube Server side WebHooks are added for Jenkins to receive QualityGate Status
}
}
}
post {
always {
notifyStatus() // Notify Status to Committer
updateKafka() // Push Execution Metadata to Kafka
unitTestReport() // Upload Surefire-Reports for Jenkins BlueOcean Plugin to display
}
}