forked from LandmakTechnology/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
66 lines (63 loc) · 1.59 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
pipeline{
agent any
tools {
maven "maven3.6.0"
}
stages {
stage('1GetCode'){
steps{
sh "echo 'cloning the latest application version' "
git branch: 'feature', credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application'
}
}
stage('3Test+Build'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'testing must passed to create artifacts ' "
sh "mvn clean package"
}
}
/*
stage('4CodeQuality'){
steps{
sh "echo 'Perfoming CodeQualityAnalysis' "
sh "mvn sonar:sonar"
}
}
stage('5uploadNexus'){
steps{
sh "mvn deploy"
}
}
stage('8deploy2prod'){
steps{
deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
}
}
}
post{
always{
emailext body: '''Hey guys
Please check build status.
Thanks
Landmark
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
success{
emailext body: '''Hey guys
Good job build and deployment is successful.
Thanks
Landmark
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
failure{
emailext body: '''Hey guys
Build failed. Please resolve issues.
Thanks
Landmark
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
}
*/
}
}