-
Notifications
You must be signed in to change notification settings - Fork 308
/
Jenkins2
53 lines (53 loc) · 1.15 KB
/
Jenkins2
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
pipeline{
agent any
tools{
maven "maven3.8.4"
}
stages{
stage('1.GitClone'){
steps{
sh "echo Github cloning"
git 'https://github.com/team16flight/web-app.git'
}
}
stage('2.MavenBuild'){
steps{
sh "echo build packages"
sh "mvn clean package"
}
}
stage('3.testingtheCode'){
steps{
sh "mvn sonar:sonar"
}
}
stage('4.backupArchitfacts'){
steps{
sh "mvn deploy"
}
}
stage('5.Deploytostaging'){
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat_Cred', path: '', url: 'http://54.226.211.219:7000/')], contextPath: null, war: 'target/*.war'
}
}
stage('6.Approval'){
steps{
sh "echo Approval Needed"
timeout(time:5,unit:'DAYS'){
input message:'Approval for Production'
}
}
}
stage('7.Deploytostaging'){
steps{
deploy adapters: [tomcat9(credentialsId: 'tomcat_Cred', path: '', url: 'http://54.226.211.219:7000/')], contextPath: null, war: 'target/*.war'
}
}
stage('8.Emailnotification'){
steps{
emailext body: 'The build is success', subject: 'Build Success', to: '[email protected]'
}
}
}
}