-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.nightly
85 lines (81 loc) · 2.22 KB
/
Jenkinsfile.nightly
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
// Documentation for Jenkinsfile https://jenkins.io/doc/book/pipeline/jenkinsfile/
pipeline {
agent any
triggers {
cron('H H(0-3) * * 1-5')
}
tools {
maven 'maven-3.6.0'
jdk 'jdk11'
}
stages {
stage ('Environment') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
mvn --version
'''
}
}
stage ('Build') {
steps {
sh 'mvn -B -DskipTests clean package'
}
}
// Pick one test style, single-threaded, parallel, or matrix for a given set of tests
stage ('SingleThreadedTest') {
steps {
sh 'mvn test -Dtest.groups="SetA,SetB,SetC"'
}
}
stage ('ParallelTest') {
failFast true
parallel {
stage('Parallel Test A') {
steps {
sh 'mvn test -Dtest.groups="SetA"'
}
}
stage('Parallel Test B') {
steps {
sh 'mvn test -Dtest.groups="SetB"'
}
}
stage('Parallel Test C') {
steps {
sh 'mvn test -Dtest.groups="SetC"'
}
}
}
}
stage ('AfterParallel') {
steps {
sh 'echo "All parallel should be done"'
}
}
stage ('MatrixParallel') {
matrix {
axes {
axis {
name 'TESTGROUP'
values 'SetA', 'SetB', 'SetC'
}
}
stages {
stage('Test') {
steps {
sh 'mvn test -Dtest.groups="${TESTGROUP}"'
}
}
}
}
}
stage ('AfterMatrix') {
steps {
sh 'echo "All matrix should be done"'
junit 'target/surefire-reports/*.xml'
}
}
}
}