-
Notifications
You must be signed in to change notification settings - Fork 69
/
B38-JenkinsFile
70 lines (68 loc) · 2 KB
/
B38-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
58
59
60
61
62
63
64
65
66
67
68
69
70
pipeline {
agent none
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "maven3"
}
stages {
stage('Pull SRc Code') {
agent{
label 'buildserver'
}
steps {
// Get some code from a GitHub repository
git credentialsId: 'git_hub_un_pwd', url: 'https://github.com/venkat09docs/Maven-Java-Project.git'
}
}
stage('Compile Src Code'){
agent{
label 'buildserver'
}
steps{
sh 'mvn clean compile'
}
}
stage('Pre Deployment Testing'){
agent{
label 'buildserver'
}
steps{
sh 'mvn clean test'
}
post{
success {
junit 'target/surefire-reports/*.xml'
}
}
}
stage('Packaging Application'){
agent{
label 'buildserver'
}
steps{
sh 'mvn clean package'
}
post{
success {
archiveArtifacts artifacts: '**/*.war', followSymlinks: false
}
}
}
stage('Deploy to AppServer'){
agent{
label 'buildserver'
}
steps{
deploy adapters: [tomcat9(credentialsId: 'appserver', path: '', url: 'http://13.250.64.239:8080/')], contextPath: 'webapp', war: '**/*.war'
}
}
stage('Integration Testing'){
agent{
label 'buildserver'
}
steps{
sh 'mvn clean verify'
}
}
}
}