mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2026-01-21 18:16:23 +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') {
|
if (!skipSonarQube) {
|
||||||
when {
|
stage('SonarQube Analysis & Quality Gate') {
|
||||||
not { skipSonarQube }
|
container('gradle') {
|
||||||
}
|
withSonarQubeEnv('SonarQube') {
|
||||||
container('gradle') {
|
// 각 서비스별 테스트 및 SonarQube 분석
|
||||||
withSonarQubeEnv('SonarQube') {
|
services.each { service ->
|
||||||
// 각 서비스별 테스트 및 SonarQube 분석
|
sh """
|
||||||
services.each { service ->
|
./gradlew :${service}:test :${service}:jacocoTestReport :${service}:sonar \\
|
||||||
sh """
|
-Dsonar.projectKey=phonebill-${service}-${environment} \\
|
||||||
./gradlew :${service}:test :${service}:jacocoTestReport :${service}:sonar \\
|
-Dsonar.projectName=phonebill-${service}-${environment} \\
|
||||||
-Dsonar.projectKey=phonebill-${service}-${environment} \\
|
-Dsonar.java.binaries=build/classes/java/main \\
|
||||||
-Dsonar.projectName=phonebill-${service}-${environment} \\
|
-Dsonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml \\
|
||||||
-Dsonar.java.binaries=build/classes/java/main \\
|
-Dsonar.exclusions=**/config/**,**/entity/**,**/dto/**,**/*Application.class,**/exception/**
|
||||||
-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') {
|
||||||
// Quality Gate 확인
|
def qg = waitForQualityGate()
|
||||||
timeout(time: 10, unit: 'MINUTES') {
|
if (qg.status != 'OK') {
|
||||||
def qg = waitForQualityGate()
|
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
||||||
if (qg.status != 'OK') {
|
}
|
||||||
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user