forked from LandmakTechnology/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-declarative23
67 lines (60 loc) · 1.72 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
66
67
pipeline{
agent any
tools {
maven "maven3.9.6"
}
//options {}
//triggers {}
stages{
stage('1clone'){
steps{
sh "echo ready to automate build"
git 'https://github.com/Toba0z/maven-web-application.git'
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: 'ef240b7c-5b90-44f6-83ea-94c65e77f9b2', path: '', url: 'http://54.183.80.74:8088/')], contextPath: null, war: 'target/*war'
sh "echo deployment to production completed successfully"
}
}
}
post{
failure{
emailext body: '''Hi Team,
Build failed
Toba tel: 2507132022''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: '[email protected]'
}
success{
emailext body: '''Hi Team,
Build succeeded..
Toba tel: 2507132022''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: '[email protected]'
}
always{
emailext body: '''Hi Team,
Build status
Toba tel: 2507132022''', recipientProviders: [developers(), requestor(), buildUser()], subject: 'Build status', to: '[email protected]'
}
}
}