forked from Landmark-Technologies/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Jenkinsfile-declarative23
65 lines (60 loc) · 1.64 KB
/
Jenkinsfile-declarative23
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
pipeline{
agent any
tools {
maven "maven3.8.2"
}
//options {}
//triggers {}
stages{
stage('1clone'){
steps{
sh "echo ready to automate build"
git 'https://github.com/LandmakTechnology/maven-web-application'
sh "echo latest application version collected from SCM"
}
}
stage('2build'){
steps{
sh "echo build process starts "
sh "mvn clean package"
sh "echo build process ends"
}
}
stage('3review'){
steps{
sh "echo CodeQuality review starts "
sh "mvn sonar:sonar"
sh "echo CodeQuality review ends"
}
}
stage('4UploadArtifacts'){
steps{
sh "mvn deploy"
sh "echo build and release job completed successfully"
}
}
stage('5deployment'){
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat-credentials', path: '', url: 'http://54.166.85.32:8177/')], contextPath: null, war: 'target/*war'
sh "echo deployment to production completed successfully"
}
}
}
post{
failure{
emailext body: '''Hi Team,
Build failed
Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers'
}
success{
emailext body: '''Hi Team,
Build succeeded
Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers'
}
always{
emailext body: '''Hi Team,
Build status
Landmark Technologies''', recipientProviders: [developers(), contributor()], subject: 'build status', to: 'developers'
}
}
}