-
Notifications
You must be signed in to change notification settings - Fork 7
/
Jenkinsfiles-declarative
63 lines (60 loc) · 1.62 KB
/
Jenkinsfiles-declarative
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
pipeline{
agent any
tools {
maven "maven3.9.2"
}
stages {
stage('1GetCode'){
steps{
sh "echo 'cloning the latest application version' "
git branch: 'master', url: 'https://github.com/Lion-Technology-Solutions/liontech-welcomeapp-cicd-pipelines.git'
}
}
stage('3Test+Build'){
steps{
sh "echo 'running JUnit-test-cases' "
sh "echo 'class20 engineers in actions' "
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: [tomcat9(credentialsId: 'admin-deploy', path: '', url: 'http://3.99.218.226:8009/')], contextPath: 'class20-wecome-app', war: 'target/*war' }
}
}
post{
always{
emailext body: '''Hey guys
Please check build status.
Thanks
Lion Tech
+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
Lion Tech
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
failure{
emailext body: '''Hey guys
Build failed. Please resolve issues.
Thanks
Lion Tech
+1 437 215 2483''', recipientProviders: [buildUser(), developers()], subject: 'success', to: '[email protected]'
}
}
}