forked from anujdevopslearn/MavenBuild
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
33 lines (27 loc) · 860 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
node('') {
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://35.153.67.119:9000 -Dsonar.login=77467cfd2653653ad3b35463fbfdb09285f08be5'
}
stage ('Archive Artifacts'){
archiveArtifacts artifacts: 'target/*.war'
}
stage ('Deployment'){
deploy adapters: [tomcat9(credentialsId: 'TomcatCreds', path: '', url: 'http://localhost:8081/')], contextPath: "Roshan Portfolio", war: 'target/*.war'
}
stage ('Notification'){
emailext (
subject: "Job Completed",
body: "Jenkins Pipeline Job for Maven Build got completed !!!",
to: "[email protected]"
)
}
}