forked from LandmakTechnology/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkinsfiledec
47 lines (40 loc) · 1.51 KB
/
jenkinsfiledec
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
node{
def mavenHome = tool name: 'maven3.9.6'
stage('1.clonecode'){
git "https://github.com/LandmakTechnology/maven-web-application"
}
stage('2.mavenBuild'){
sh "${mavenHome}/bin/mvn package"
}
stage('3.codeQualityAnalysis'){
sh "${mavenHome}/bin/mvn sonar:sonar"
}
stage('4.uploadArtifacts'){
sh "${mavenHome}/bin/mvn deploy"
}
stage('5.deploy2UAT'){
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war'
}
stage('6.ManualApproval'){
sh " echo 'Please review & approve' "
timeout(time:300, unit:'MINUTES')
{
input message: 'Application ready for deployment, Please review and approve'
}
}
stage('7.deploy2prod'){
//use deploy to container plugin
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://3.144.85.2:8088/')], contextPath: null, war: 'target/*war'
}
stage('8.apm'){
sh "echo 'monitoring and observation and alerting' "
sh "echo 'application performance Monitoring in progress' "
}
stage('9.notification'){
sh "echo create email notification to resolve any issue that may arise"
//use pipeline syntax and email notification plugin to achieve this
emailext body: '''The build and Deployment status for tesla-webapp.
Regards,
Landmark Technologies''', recipientProviders: [developers(), upstreamDevelopers(), buildUser()], subject: 'job status', to: '[email protected]'
}
}