forked from vikash-kumar01/mrdevops_java_app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
37 lines (35 loc) · 888 Bytes
/
Jenkinsfile
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
@Library("my-shared-library") _
pipeline {
agent any
stages {
stage("Clean Workspace"){
steps{
cleanWs()
}
}
stage("Git Checkout"){
steps{
git branch: 'main', credentialsId: 'gitcred', url: 'https://github.com/siddharth201983/sample_java_app.git'
}
}
stage("Test Application"){
steps{
sh 'mvn test'
}
}
stage("Integration Test maven"){
steps{
sh 'mvn verify -DskipUnitTests'
}
}
stage("SonarQube Analysis"){
steps{
script{
withSonarQubeEnv(credentialsId: 'sonaqube-api') {
sh 'mvn clean package sonar:sonar'
}
}
}
}
}
}