mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2026-01-21 10:06:24 +00:00
Scripted Pipeline 문법 오류 수정
- when 지시어를 if 문으로 변경하여 Scripted Pipeline 호환성 확보 - SonarQube 조건부 실행을 위한 올바른 문법 적용 - 백엔드 CI/CD 가이드에 동일한 문법 반영
This commit is contained in:
parent
d596780a64
commit
8064def373
45
deployment/cicd/Jenkinsfile
vendored
45
deployment/cicd/Jenkinsfile
vendored
@ -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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user