File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ def userInput = true
2+ def didTimeout = false
3+ node (' master' ){
4+ stage(' Checkout' ){
5+ git branch : ' master' , url : ' https://github.com/BINPIPE/java-springboot-sonarqube.git'
6+ }
7+
8+ stage(' Build' ){
9+ // sh 'mvn clean package -Dmaven.test.skip=true -U'
10+ sh ' mvn clean install'
11+ }
12+
13+ stage(' Sonar Scan' ){
14+
15+ sh " mvn sonar:sonar -Dmaven.test.skip=true"
16+ }
17+
18+ stage(" Quality Gate" ){
19+
20+ timeout(time : 1 , unit : ' MINUTES' ) { // ---Just in case something goes wrong, pipeline will be killed after a timeout
21+ sleep 10 // ---Allow time for Sonar Scan to be over in Server (To Do: Replace this with webhook!)
22+ def qg = waitForQualityGate() // --Reuse taskId previously collected by withSonarQubeEnv
23+ if (qg. status != ' OK' ) {
24+ error " Pipeline aborted due to quality gate failure: ${ qg.status} "
25+
26+ }
27+ }
28+ }
29+ stage(' Deploy' ){
30+ sh ' echo Moving ahead with Deployment to Endpoints!'
31+
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments