forked from MithunTechnologiesDevOps/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
75 lines (58 loc) · 1.71 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
pipeline{
agent any
tools{
maven 'maven3.8.2'
}
triggers{
pollSCM('* * * * *')
}
options{
timestamps()
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '5', daysToKeepStr: '', numToKeepStr: '5'))
}
stages{
stage('CheckOutCode'){
steps{
git branch: 'development', credentialsId: '957b543e-6f77-4cef-9aec-82e9b0230975', url: 'https://github.com/devopstrainingblr/maven-web-application-1.git'
}
}
stage('Build'){
steps{
sh "mvn clean package"
}
}
/*
stage('ExecuteSonarQubeReport'){
steps{
sh "mvn clean sonar:sonar"
}
}
stage('UploadArtifactsIntoNexus'){
steps{
sh "mvn clean deploy"
}
}
stage('DeployAppIntoTomcat'){
steps{
sshagent(['bfe1b3c1-c29b-4a4d-b97a-c068b7748cd0']) {
sh "scp -o StrictHostKeyChecking=no target/maven-web-application.war [email protected]:/opt/apache-tomcat-9.0.50/webapps/"
}
}
}
*/
}//Stages Closing
post{
success{
emailext to: '[email protected],[email protected]',
subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
replyTo: '[email protected]'
}
failure{
emailext to: '[email protected],[email protected]',
subject: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
body: "Pipeline Build is over .. Build # is ..${env.BUILD_NUMBER} and Build status is.. ${currentBuild.result}.",
replyTo: '[email protected]'
}
}
}//Pipeline closing