forked from jenkinsci/pipeline-model-definition-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
107 lines (102 loc) · 4.3 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
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
98
99
100
101
102
103
104
105
106
107
// This Jenkinsfile's main purpose is to show a real-world-ish example
// of what Pipeline config syntax actually looks like.
pipeline {
// Make sure that the tools we need are installed and on the path.
tools {
maven "mvn"
jdk "jdk8"
}
agent none
// Set log rotation, timeout and timestamps in the console
options {
buildDiscarder(logRotator(numToKeepStr:'10'))
timestamps()
timeout(time: 90, unit: 'MINUTES')
}
// Make sure we have GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL set due to machine weirdness.
environment {
GIT_COMMITTER_NAME = "jenkins"
GIT_COMMITTER_EMAIL = "jenkins@jenkins.io"
NEWER_CORE_VERSION = "2.121.3"
TEST_TIMEOUT = "600"
}
stages {
// While there is only one stage here, you can specify as many stages as you like!
stage("build") {
parallel {
stage("linux") {
agent {
label "highmem"
}
steps {
sh 'mvn clean install -Dmaven.test.failure.ignore=true -Djenkins.test.timeout=${TEST_TIMEOUT}'
}
post {
// No matter what the build status is, run this step. There are other conditions
// available as well, such as "success", "failed", "unstable", and "changed".
always {
junit testResults: '*/target/surefire-reports/*.xml', keepLongStdio: true
}
success {
archive "**/target/*.hpi"
archive "**/target/site/jacoco/jacoco.xml"
}
unstable {
archive "**/target/*.hpi"
archive "**/target/site/jacoco/jacoco.xml"
}
}
}
stage("windows") {
agent {
label "windows"
}
steps {
bat 'mvn clean install -Dconcurrency=1 -Dmaven.test.failure.ignore=true -Dcodenarc.skip=true -Djenkins.test.timeout=${TEST_TIMEOUT}'
}
post {
always {
junit testResults: '*/target/surefire-reports/*.xml', keepLongStdio: true
}
}
}
stage("linux-newer-core") {
agent {
label "highmem"
}
steps {
sh "mvn clean install -Dmaven.test.failure.ignore=true -Djava.level=8 -Djenkins.test.timeout=${TEST_TIMEOUT} -Djenkins.version=${NEWER_CORE_VERSION}"
}
post {
// No matter what the build status is, run this step. There are other conditions
// available as well, such as "success", "failed", "unstable", and "changed".
always {
junit testResults: '*/target/surefire-reports/*.xml', keepLongStdio: true
}
success {
archive "**/target/*.hpi"
archive "**/target/site/jacoco/jacoco.xml"
}
unstable {
archive "**/target/*.hpi"
archive "**/target/site/jacoco/jacoco.xml"
}
}
}
stage("windows-newer-core") {
agent {
label "windows"
}
steps {
bat "mvn clean install -Dconcurrency=1 -Dmaven.test.failure.ignore=true -Dcodenarc.skip=true -Djava.level=8 -Djenkins.test.timeout=${TEST_TIMEOUT} -Djenkins.version=${NEWER_CORE_VERSION}"
}
post {
always {
junit testResults: '*/target/surefire-reports/*.xml', keepLongStdio: true
}
}
}
}
}
}
}