forked from LandmakTechnology/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-sep23-decl
81 lines (72 loc) · 2.35 KB
/
Jenkinsfile-sep23-decl
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
76
77
78
79
80
81
pipeline{
agent any
tools{
maven 'maven3.9.4'
}
//options{}
//triggers{}
stages{
stage('1.CloneCode'){
steps{
sh "echo 'cloning the latest application version' "
git "https://github.com/LandmakTechnology/maven-web-application"
}
}
stage('2.mvnBuild'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'testing must passed to create artifacts ' "
sh "mvn clean package"
}
}
stage('3.CodeQuality'){
steps{
sh "echo 'Perfoming CodeQualityAnalysis' "
//sh "mvn sonar:sonar"
}
}
stage('4.UploadArtifacts'){
steps{
sh "mvn deploy"
}
}
stage('5.Deploy2UAT'){
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
}
}
stage('6.ManualApproval'){
steps{
sh "echo 'Please review the application performance' "
timeout(time:600, unit:'MINUTES') {
input message: 'Application ready for deployment, Please review and approve'
}
}
}
stage('7.Deploy2Prod'){
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://34.219.51.216:8177/')], contextPath: null, war: 'target/*war'
}
}
}
post{
always{
emailext body: '''Hi Team,
The build and Deployment status for is a success.
Regards,
Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: '[email protected]'
}
success{
emailext body: '''Hi Team,
The build and Deployment is a success.
Regards,
Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: '[email protected]'
}
failure{
emailext body: '''Hi Team,
The build and Deployment failed.
Regards,
Landmark Technologies ''', recipientProviders: [buildUser(), contributor(), developers(), requestor()], subject: 'build and deployment status', to: '[email protected]'
}
}
}