forked from edureka-git/DevOpsClassCodes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsFile
More file actions
99 lines (82 loc) · 2.81 KB
/
JenkinsFile
File metadata and controls
99 lines (82 loc) · 2.81 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
pipeline {
agent any
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "mymaven"
jdk "myjava"
}
stages {
stage('Compile')
{
steps
{
// Get some code from a GitHub repository
git 'https://github.com/gitisha84/DevOpsClassCodes.git'
// Run Maven on a Unix agent.
sh "mvn compile"
// To run Maven on a Windows agent, use
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
stage('CodeReview')
{
steps
{
// Get some code from a GitHub repository
//git 'https://github.com/gitisha84/DevOpsClassCodes.git'
// Run Maven on a Unix agent.
sh "mvn pmd:pmd"
// To run Maven on a Windows agent, use
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
stage('UnitTest')
{
steps
{
// Get some code from a GitHub repository
//git 'https://github.com/gitisha84/DevOpsClassCodes.git'
// Run Maven on a Unix agent.
sh "mvn test"
// To run Maven on a Windows agent, use
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
stage('UniTest')
{
steps
{
// Get some code from a GitHub repository
//git 'https://github.com/gitisha84/DevOpsClassCodes.git'
// Run Maven on a Unix agent.
sh "mvn test"
// To run Maven on a Windows agent, use
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
stage('MetricCheck')
{
steps
{
// Get some code from a GitHub repository
//git 'https://github.com/gitisha84/DevOpsClassCodes.git'
// Run Maven on a Unix agent.
sh "mvn cobertura:cobertura -Dcobertura.report.format=xml"
// To run Maven on a Windows agent, use
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
stage('Package')
{
steps
{
// Get some code from a GitHub repository
//git 'https://github.com/gitisha84/DevOpsClassCodes.git'
// Run Maven on a Unix agent.
sh "mvn package"
// To run Maven on a Windows agent, use
// bat "mvn -Dmaven.test.failure.ignore=true clean package"
}
}
}
}