-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathJenkinsfile
More file actions
37 lines (35 loc) · 1.05 KB
/
Copy pathJenkinsfile
File metadata and controls
37 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pipeline {
agent any
environment {
PATH = "/opt/maven/bin:$PATH"
}
stages {
stage('Build') {
steps {
sh 'mvn clean install'
}
}
stage('SonarQube Analysis') {
environment {
scannerHome = tool 'bharath-sonarqube-scanner'
}
steps {
withSonarQubeEnv('Bharath-SonarQube-Server') {
sh "${scannerHome}/bin/sonar-scanner"
}
}
}
stage('Quality Gate') {
steps {
script {
timeout(time: 1, unit: 'hours') { // Corrected 'Hours' -> 'hours'
def qg = waitForQualityGate() // Fixed function name
if (qg.status != 'OK') { // Ensure 'OK' is capitalized correctly
error "Pipeline aborted due to Quality Gate failure: ${qg.status}"
}
}
}
}
}
}
}