Skip to content

Commit 29522e9

Browse files
authored
Create Jenkinsfiles-declarative29
1 parent 1993c9a commit 29522e9

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

Jenkinsfiles-declarative29

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
pipeline{
2+
agent any
3+
tools {
4+
maven "maven3.6.0"
5+
}
6+
stages {
7+
stage('1GetCode'){
8+
steps{
9+
sh "echo 'cloning the latest application version' "
10+
git branch: 'feature', credentialsId: 'gitHubCredentials', url: 'https://github.com/LandmakTechnology/maven-web-application'
11+
}
12+
}
13+
stage('3Test+Build'){
14+
steps{
15+
sh "echo 'running JUnit-test-cases' "
16+
sh "echo 'testing must passed to create artifacts ' "
17+
sh "mvn clean package"
18+
}
19+
}
20+
stage('4CodeQuality'){
21+
steps{
22+
sh "echo 'Perfoming CodeQualityAnalysis' "
23+
sh "mvn sonar:sonar"
24+
}
25+
}
26+
stage('5uploadNexus'){
27+
steps{
28+
sh "mvn deploy"
29+
}
30+
}
31+
stage('8deploy2prod'){
32+
steps{
33+
deploy adapters: [tomcat8(credentialsId: 'tomcat-credentials', path: '', url: 'http://35.170.249.131:8080/')], contextPath: null, war: 'target/*war'
34+
}
35+
}
36+
}
37+
post{
38+
always{
39+
emailext body: '''Hey guys
40+
Please check build status.
41+
42+
Thanks
43+
Landmark
44+
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
45+
}
46+
success{
47+
emailext body: '''Hey guys
48+
Good job build and deployment is successful.
49+
50+
Thanks
51+
Landmark
52+
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
53+
}
54+
failure{
55+
emailext body: '''Hey guys
56+
Build failed. Please resolve issues.
57+
58+
Thanks
59+
Landmark
60+
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)