ci: integrate SonarQube analysis and quality gate
Some checks failed
Tests / Backend - Tests skipped: 7, passed: 27
Backend Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 60.55% (333/550)
* Lines of Code: 550
#### Quality Gates Summary
No active quality gates.
Tests / Frontend - Lint, Tests et Build passed: 45
Frontend Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 86.14% (230/267)
* Lines of Code: 267
#### Quality Gates Summary
No active quality gates.
THE-TIP-TOP-MULTIBRANCH/pipeline/head There was a failure building this commit
Some checks failed
Tests / Backend - Tests skipped: 7, passed: 27
Backend Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 60.55% (333/550)
* Lines of Code: 550
#### Quality Gates Summary
No active quality gates.
Tests / Frontend - Lint, Tests et Build passed: 45
Frontend Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 86.14% (230/267)
* Lines of Code: 267
#### Quality Gates Summary
No active quality gates.
THE-TIP-TOP-MULTIBRANCH/pipeline/head There was a failure building this commit
This commit is contained in:
44
Jenkinsfile
vendored
44
Jenkinsfile
vendored
@@ -272,6 +272,50 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarQube Analysis') {
|
||||
when {
|
||||
branch 'develop'
|
||||
}
|
||||
|
||||
steps {
|
||||
script {
|
||||
def scannerHome = tool 'sonar-scanner'
|
||||
|
||||
withSonarQubeEnv('sonarqube') {
|
||||
withCredentials([
|
||||
string(
|
||||
credentialsId: 'sonarqube-token',
|
||||
variable: 'SONAR_TOKEN'
|
||||
)
|
||||
]) {
|
||||
sh """
|
||||
${scannerHome}/bin/sonar-scanner \
|
||||
-Dsonar.projectKey=the-tip-top \
|
||||
-Dsonar.projectName=THE-TIP-TOP \
|
||||
-Dsonar.sources=backend/src,frontend/src \
|
||||
-Dsonar.tests=backend/tests,frontend/src/test \
|
||||
-Dsonar.javascript.lcov.reportPaths=backend/coverage/lcov.info,frontend/coverage/lcov.info \
|
||||
-Dsonar.exclusions=**/node_modules/**,**/coverage/**,**/dist/** \
|
||||
-Dsonar.sourceEncoding=UTF-8 \
|
||||
-Dsonar.token="${SONAR_TOKEN}"
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarQube Quality Gate') {
|
||||
when {
|
||||
branch 'develop'
|
||||
}
|
||||
|
||||
steps {
|
||||
timeout(time: 5, unit: 'MINUTES') {
|
||||
waitForQualityGate abortPipeline: true
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Construction des images Docker') {
|
||||
when {
|
||||
expression {
|
||||
|
||||
Reference in New Issue
Block a user