-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
113 lines (98 loc) · 3.54 KB
/
Copy pathJenkinsfile
File metadata and controls
113 lines (98 loc) · 3.54 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Pipeline
{
agent any
stages
{
stage('ContinuousDownload')
{
steps
{
script
{
try
{
git 'https://github.com/intelliqittrainings/maven.git'
}
catch(Exception e1)
{
mail bcc: '', body: 'Jenkins is unable to download from the remote github', cc: '', from: '', replyTo: '', subject: 'Download Failed', to: 'git.admin@gmail.com'
exit(1)
}
}
}
}
stage('ContinuousBuild')
{
steps
{
script
{
try
{
sh 'mvn package'
}
catch(Exception e2)
{
mail bcc: '', body: 'Jenkins is unable to create an artifact from the downloaded code', cc: '', from: '', replyTo: '', subject: 'Build Failed', to: 'dev.team@gmail.com'
exit(1)
}
}
}
}
stage('ContinuousDeployment')
{
steps
{
script
{
try
{
deploy adapters: [tomcat9(credentialsId: 'fe952420-a9b2-41ec-a39c-f8949fe660bb', path: '', url: 'http://172.31.59.157:8080')], contextPath: 'test1', war: '**/*.war'
}
catch(Exception e3)
{
mail bcc: '', body: 'Jenkins is unable to deploy to tomcat on qaservers', cc: '', from: '', replyTo: '', subject: 'Deployment Failed', to: 'middleware.team@gmail.com'
exit(1)
}
}
}
}
stage('ContinuousTesting')
{
steps
{
script
{
try
{
git 'https://github.com/intelliqittrainings/FunctionalTesting.git'
sh 'java -jar /home/ubuntu/.jenkins/workspace/NewDeclarativePipeline/testing.jar'
}
catch(Exception e4)
{
mail bcc: '', body: 'Selenium test scripts are giving a failure status', cc: '', from: '', replyTo: '', subject: 'Testing Failed', to: 'qa.team@gmail.com'
exit(1)
}
}
}
}
stage('ContinuousDelivery')
{
steps
{
script
{
try
{
input message: 'Approval Required!', submitter: 'rahul'
deploy adapters: [tomcat9(credentialsId: 'fe952420-a9b2-41ec-a39c-f8949fe660bb', path: '', url: 'http://172.31.54.121:8080')], contextPath: 'prod1', war: '**/*.war'
}
catch(Exception e5)
{
mail bcc: '', body: 'Jenkins is unable to deploy into tomcat on prodservers', cc: '', from: '', replyTo: '', subject: 'Delivery Failed', to: 'delivery.team@gmail.com'
}
}
}
}
}
}