mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2025-12-06 08:06:24 +00:00
Compare commits
2 Commits
698c146393
...
608d467691
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
608d467691 | ||
|
|
81ad3d1624 |
46
deployment/cicd/Jenkinsfile
vendored
46
deployment/cicd/Jenkinsfile
vendored
@ -18,6 +18,11 @@ podTemplate(
|
||||
spec:
|
||||
terminationGracePeriodSeconds: 3
|
||||
restartPolicy: Never
|
||||
tolerations:
|
||||
- effect: NoSchedule
|
||||
key: dedicated
|
||||
operator: Equal
|
||||
value: cicd
|
||||
''',
|
||||
containers: [
|
||||
containerTemplate(
|
||||
@ -76,7 +81,7 @@ podTemplate(
|
||||
props = readProperties file: "deployment/cicd/config/deploy_env_vars_${environment}"
|
||||
}
|
||||
|
||||
stage("Setup Kubernetes2") {
|
||||
stage("Setup Kubernetes") {
|
||||
container('kubectl') {
|
||||
sh """
|
||||
kubectl create namespace ${props.namespace} --dry-run=client -o yaml | kubectl apply -f -
|
||||
@ -93,45 +98,6 @@ podTemplate(
|
||||
}
|
||||
}
|
||||
|
||||
stage('SonarQube Analysis & Quality Gate') {
|
||||
if (skipSonarQube) {
|
||||
echo "⏭️ Skipping SonarQube Analysis (SKIP_SONARQUBE=${params.SKIP_SONARQUBE})"
|
||||
} else {
|
||||
container('gradle') {
|
||||
// 각 서비스별로 개별적으로 SonarQube 분석 및 Quality Gate 확인
|
||||
services.each { service ->
|
||||
withSonarQubeEnv('SonarQube') {
|
||||
echo "🔍 Starting SonarQube analysis for ${service}..."
|
||||
|
||||
// 서비스별 테스트 및 SonarQube 분석
|
||||
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/**
|
||||
"""
|
||||
|
||||
echo "✅ SonarQube analysis completed for ${service}"
|
||||
}
|
||||
|
||||
// 각 서비스별 Quality Gate 확인
|
||||
timeout(time: 5, unit: 'MINUTES') {
|
||||
echo "⏳ Waiting for Quality Gate result for ${service}..."
|
||||
def qg = waitForQualityGate()
|
||||
if (qg.status != 'OK') {
|
||||
error "❌ Quality Gate failed for ${service}: ${qg.status}"
|
||||
} else {
|
||||
echo "✅ Quality Gate passed for ${service}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "🎉 All services passed SonarQube Quality Gates!"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build & Push Images') {
|
||||
timeout(time: 30, unit: 'MINUTES') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user