-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Jenkinsfile
125 lines (117 loc) · 4.96 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!groovy
pipeline {
agent none
// save some io during the build
options {
skipDefaultCheckout()
durabilityHint('PERFORMANCE_OPTIMIZED')
buildDiscarder logRotator( numToKeepStr: '60' )
}
stages {
stage("Parallel Stage") {
parallel {
stage("Build / Test - JDK8") {
agent { node { label 'linux' } }
steps {
timeout( time: 240, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk8", "clean install", "maven3")
// Collect up the jacoco execution results (only on main build)
jacoco inclusionPattern: '**/org/eclipse/jetty/**/*.class',
exclusionPattern: '' +
// build tools
'**/org/eclipse/jetty/ant/**' + ',**/org/eclipse/jetty/maven/**' +
',**/org/eclipse/jetty/jspc/**' +
// example code / documentation
',**/org/eclipse/jetty/embedded/**' + ',**/org/eclipse/jetty/asyncrest/**' +
',**/org/eclipse/jetty/demo/**' +
// special environments / late integrations
',**/org/eclipse/jetty/gcloud/**' + ',**/org/eclipse/jetty/infinispan/**' +
',**/org/eclipse/jetty/osgi/**' + ',**/org/eclipse/jetty/spring/**' +
',**/org/eclipse/jetty/http/spi/**' +
// test classes
',**/org/eclipse/jetty/tests/**' + ',**/org/eclipse/jetty/test/**',
execPattern: '**/target/jacoco.exec',
classPattern: '**/target/classes',
sourcePattern: '**/src/main/java'
recordIssues id: "jdk8", name: "Static Analysis jdk8", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
}
}
}
/*
stage("Build / Test - JDK11") {
agent { node { label 'linux' } }
steps {
timeout( time: 240, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk11", "clean install -Djacoco.skip=true -Perrorprone", "maven3")
recordIssues id: "jdk11", name: "Static Analysis jdk11", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser(), errorProne()]
}
}
}
stage("Build / Test - JDK17") {
agent { node { label 'linux' } }
steps {
timeout( time: 240, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk17", "clean install -Djacoco.skip=true", "maven3")
recordIssues id: "jdk17", name: "Static Analysis jdk17", aggregatingResults: true, enabledForFailure: true, tools: [mavenConsole(), java(), checkStyle(), spotBugs(), pmdParser()]
}
}
}
*/
stage("Build Javadoc") {
agent { node { label 'linux' } }
steps {
timeout( time: 120, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk11",
"install javadoc:javadoc javadoc:aggregate-jar -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true",
"maven3")
recordIssues id: "javadoc", enabledForFailure: true, tools: [javaDoc()]
}
}
}
/*
stage("Build Compact3") {
agent { node { label 'linux' } }
steps {
timeout( time: 120, unit: 'MINUTES' ) {
checkout scm
mavenBuild( "jdk8", "-Pcompact3 clean install -DskipTests", "maven3")
}
}
}
*/
}
}
}
}
/**
* To other developers, if you are using this method above, please use the following syntax.
*
* mavenBuild("<jdk>", "<profiles> <goals> <plugins> <properties>"
*
* @param jdk the jdk tool name (in jenkins) to use for this build
* @param cmdline the command line in "<profiles> <goals> <properties>"`format.
* @param consoleParsers array of console parsers to run
*/
def mavenBuild(jdk, cmdline, mvnName) {
script {
try {
withEnv(["JAVA_HOME=${ tool "$jdk" }",
"PATH+MAVEN=${ tool "$jdk" }/bin:${tool "$mvnName"}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider(
[configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Dmaven.repo.local=.repository -Pci -V -B -e $cmdline -Dunix.socket.tmp=/tmp/unixsocket"
}
}
}
finally
{
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
}
}
}
// vim: et:ts=2:sw=2:ft=groovy