forked from coolgourav147/spring-boot-war-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
57 lines (49 loc) · 1.56 KB
/
Jenkinsfile
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
pipeline {
agent any
tools {
maven 'Maven'
}
stages {
stage("Test"){
steps{
// mvn test
sh "mvn test"
slackSend channel: 'youtubejenkins', message: 'Job Started'
}
}
stage("Build"){
steps{
sh "mvn package"
}
}
stage("Deploy on Test"){
steps{
// deploy on container -> plugin
deploy adapters: [tomcat9(credentialsId: 'tomcatserverdetails1', path: '', url: 'http://192.168.0.118:8080')], contextPath: '/app', war: '**/*.war'
}
}
stage("Deploy on Prod"){
input {
message "Should we continue?"
ok "Yes we Should"
}
steps{
// deploy on container -> plugin
deploy adapters: [tomcat9(credentialsId: 'tomcatserverdetails1', path: '', url: 'http://192.168.0.119:8080')], contextPath: '/app', war: '**/*.war'
}
}
}
post{
always{
echo "========always========"
}
success{
echo "========pipeline executed successfully ========"
slackSend channel: 'youtubejenkins', message: 'Success'
}
failure{
echo "========pipeline execution failed========"
slackSend channel: 'youtubejenkins', message: 'Job Failed'
}
}
}