forked from ramchandra-guthula/sample-java-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonar_jenkinsfile_declarative
More file actions
28 lines (27 loc) · 928 Bytes
/
sonar_jenkinsfile_declarative
File metadata and controls
28 lines (27 loc) · 928 Bytes
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
pipeline {
agent any
stages {
stage('SCM') {
steps {
git url: 'https://github.com/ramchandra-guthula/sample-java-app.git'
}
}
stage('build && SonarQube analysis') {
steps {
withSonarQubeEnv('sonar-8.3') { // Use the sonar server configuration name not scanner
// Optionally use a Maven environment you've configured already
sh 'mvn clean package sonar:sonar'
}
}
}
stage("Quality Gate") {
steps {
timeout(time: 1, unit: 'HOURS') {
// Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails
// true = set pipeline to UNSTABLE, false = don't
waitForQualityGate abortPipeline: true
}
}
}
}
}