forked from Landmark-Technologies/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Jenkinfile-dec-March2024
96 lines (84 loc) · 2.46 KB
/
Jenkinfile-dec-March2024
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
pipeline{
agent any
//options{}
//triggers{}
tools {
maven 'maven3.9.6'
}
stages{
stage('1.CloneCode'){
steps{
sh "echo cloning the latest app version"
git 'https://github.com/LandmakTechnology/maven-web-application'
}
}
stage('2.mvnBuild'){
steps{
sh "echo validate, compile and perform UnitTesting"
sh "echo UnitTesting must passed for artifacts to be created"
sh "mvn clean package"
}
}
}
/*
stage('3.CodeQuality'){
steps{
//sh "mvn sonar:sonar"
sh "echo CodeQualityAnalysis completed"
}
}
stage('4.UploadArtifacts'){
steps{
sh "mvn deploy"
sh "echo artifacts uploaded successfully"
sh "echo I am now a Build and Release Engineer"
sh "echo Build and release completed"
}
}
stage('5.Deploy2UAT'){
steps{
sh "echo Deployment is ready for the client review"
sh "echo using deploy to container plugin"
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://172.31.30.76:8080/')], contextPath: null, war: 'target/*war'
}
}
stage('6.ManualApproval'){
steps{
sh "echo Please Review and confirm within 5 days"
timeout(time:5, unit:'DAYS'){
input message: 'Application ready for deployment, Please review and approve'
}
}
}
stage('7.Deploy2Prod'){
steps{
sh "echo application reviewed, approved and ready for the market"
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://172.31.30.76:8080/')], contextPath: null, war: 'target/*war'
}
}
}
post{
always{
emailext body: '''Hi Team,
Build status.
Landmark Technologies.
Tel: +1 437 215 2483
''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: '[email protected]'
}
success{
emailext body: '''Hi Team,
Build succeeded.
Landmark Technologies.
Tel: +1 437 215 2483
''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: '[email protected]'
}
failure{
emailext body: '''Hi Team,
Build failed.
Landmark Technologies.
Tel: +1 437 215 2483
''', recipientProviders: [buildUser(), developers(), contributor()], subject: 'Build status', to: '[email protected]'
}
}
*/
}