forked from shubham-traqmatix/MavenBuild
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathJenkinsfile
More file actions
33 lines (28 loc) · 819 Bytes
/
Jenkinsfile
File metadata and controls
33 lines (28 loc) · 819 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
29
30
31
32
33
node('master') {
stage ('checkout code'){
checkout scm
}
stage ('Build'){
sh "mvn clean install -Dmaven.test.skip=true"
}
stage ('Test Cases Execution'){
sh "mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Pcoverage-per-test"
}
stage ('Sonar Analysis'){
sh 'mvn sonar:sonar -Dsonar.host.url=http://52.90.114.217:9000 -Dsonar.login=3f2d512066c968a048575e6a0001e6bcffe61601'
}
stage ('Archive Artifacts'){
archiveArtifacts artifacts: 'target/*.war'
}
stage ('Deployment'){
//sh 'cp target/*.war /opt/tomcat8/webapps'
}
stage ('Notification'){
//slackSend color: 'good', message: 'Deployment Sucessful'
emailext (
subject: "Job Completed",
body: "Jenkins Pipeline Job for Maven Build got completed !!!",
to: "devopseng129@gmail.com"
)
}
}