diff --git a/deployment/cicd/Jenkinsfile b/deployment/cicd/Jenkinsfile index b28b239..e0cf799 100644 --- a/deployment/cicd/Jenkinsfile +++ b/deployment/cicd/Jenkinsfile @@ -101,29 +101,28 @@ podTemplate( } } - stage('SonarQube Analysis & Quality Gate') { - when { - not { skipSonarQube } - } - container('gradle') { - withSonarQubeEnv('SonarQube') { - // 각 서비스별 테스트 및 SonarQube 분석 - services.each { service -> - sh """ - ./gradlew :${service}:test :${service}:jacocoTestReport :${service}:sonar \\ - -Dsonar.projectKey=phonebill-${service}-${environment} \\ - -Dsonar.projectName=phonebill-${service}-${environment} \\ - -Dsonar.java.binaries=build/classes/java/main \\ - -Dsonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml \\ - -Dsonar.exclusions=**/config/**,**/entity/**,**/dto/**,**/*Application.class,**/exception/** - """ - } - - // Quality Gate 확인 - timeout(time: 10, unit: 'MINUTES') { - def qg = waitForQualityGate() - if (qg.status != 'OK') { - error "Pipeline aborted due to quality gate failure: ${qg.status}" + if (!skipSonarQube) { + stage('SonarQube Analysis & Quality Gate') { + container('gradle') { + withSonarQubeEnv('SonarQube') { + // 각 서비스별 테스트 및 SonarQube 분석 + services.each { service -> + sh """ + ./gradlew :${service}:test :${service}:jacocoTestReport :${service}:sonar \\ + -Dsonar.projectKey=phonebill-${service}-${environment} \\ + -Dsonar.projectName=phonebill-${service}-${environment} \\ + -Dsonar.java.binaries=build/classes/java/main \\ + -Dsonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml \\ + -Dsonar.exclusions=**/config/**,**/entity/**,**/dto/**,**/*Application.class,**/exception/** + """ + } + + // Quality Gate 확인 + timeout(time: 10, unit: 'MINUTES') { + def qg = waitForQualityGate() + if (qg.status != 'OK') { + error "Pipeline aborted due to quality gate failure: ${qg.status}" + } } } }