Skip to content

Commit b2c4040

Browse files
committed
🔧 chore[Jenkinsfile]: update Git URL and remove unused stages
1 parent 06553c0 commit b2c4040

1 file changed

Lines changed: 1 addition & 69 deletions

File tree

‎Jenkinsfile‎

Lines changed: 1 addition & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pipeline {
22
agent any
33
environment {
4-
GIT_URL = 'https://github.com/BSO-Space/BSOSpace-Blog-Frontend'
4+
GIT_URL = 'https://github.com/bsospace/BSOSpace-Blog-Frontend'
55
DOCKER_COMPOSE_FILE = ''
66
DOCKER_IMAGE_TAG = ''
77
APP_PORT = ''
@@ -84,74 +84,6 @@ pipeline {
8484
}
8585
}
8686

87-
stage('Code Analysis') {
88-
steps {
89-
withCredentials([string(credentialsId: 'bso-space-app', variable: 'SONAR_TOKEN')]) {
90-
script {
91-
def sonarResult = sh(
92-
script: '''
93-
npm install sonar-scanner
94-
npx sonar-scanner \
95-
-Dsonar.projectKey=bso-space-app \
96-
-Dsonar.host.url=http://labs.bsospace.com:3001 \
97-
-Dsonar.login=$SONAR_TOKEN
98-
''',
99-
returnStatus: true
100-
)
101-
102-
if (sonarResult != 0) {
103-
error "SonarQube analysis failed. Halting deployment."
104-
} else {
105-
echo "SonarQube analysis passed successfully."
106-
}
107-
}
108-
}
109-
}
110-
post {
111-
success {
112-
publishChecks name: 'Code Analysis', title: 'Code Analysis', summary: 'SonarQube analysis passed.'
113-
}
114-
failure {
115-
publishChecks name: 'Code Analysis', title: 'Code Analysis', summary: 'SonarQube analysis failed.'
116-
}
117-
}
118-
}
119-
120-
stage('Quality Gate') {
121-
steps {
122-
withCredentials([string(credentialsId: 'bso-space-app', variable: 'SONAR_TOKEN')]) {
123-
script {
124-
def response = sh(
125-
script: "curl -s -u ${SONAR_TOKEN}: https://sonarqube.bsospace.com/api/qualitygates/project_status?projectKey=bso-space-app",
126-
returnStdout: true
127-
).trim()
128-
def qualityGate = new groovy.json.JsonSlurper().parseText(response)
129-
env.QUALITY_GATE_STATUS = qualityGate?.projectStatus?.status ?: "UNKNOWN"
130-
131-
def qualitySummary = "Quality Gate Status: ${env.QUALITY_GATE_STATUS}\n"
132-
qualityGate?.projectStatus?.conditions.each { condition ->
133-
qualitySummary += "Metric: ${condition.metricKey}, Status: ${condition.status}, " +
134-
"Actual: ${condition.actualValue}, Threshold: ${condition.errorThreshold}\n"
135-
}
136-
echo qualitySummary
137-
env.QUALITY_SUMMARY = qualitySummary
138-
139-
if (env.QUALITY_GATE_STATUS != 'OK') {
140-
error "Quality Gate failed with status: ${env.QUALITY_GATE_STATUS}"
141-
}
142-
}
143-
}
144-
}
145-
post {
146-
success {
147-
publishChecks name: 'Quality Gate', title: 'Quality Gate', summary: 'Quality gate passed successfully.'
148-
}
149-
failure {
150-
publishChecks name: 'Quality Gate', title: 'Quality Gate', summary: 'Quality gate failed.'
151-
}
152-
}
153-
}
154-
15587
stage('Testing with Jest') {
15688
steps {
15789
script {

0 commit comments

Comments
 (0)