-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Jmh_Jenkinsfile
54 lines (45 loc) · 1.54 KB
/
Jmh_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
#!groovy
def branch = params.get("JETTY_BRANCH" ,"jetty-10.0.x")
def owner = params.get("REPO_OWNER", "eclipse")
def jdk = params.get("JDK", "jdk11")
def jmhJarPath = params.get("jmhJarPath","tests/jetty-jmh/target/benchmarks.jar")
currentBuild.description = "Build branch $branch with jdk $jdk"
node("linux") {
// System Dependent Locations
def mvnName = 'maven3.5'
def localRepo = "${env.JENKINS_HOME}/${env.EXECUTOR_NUMBER}"
def settingsName = 'oss-settings.xml'
def mavenOpts = '-Xms1g -Xmx4g -Djava.awt.headless=true'
stage("Checkout") {
git url: "https://github.com/$owner/jetty.project.git", branch: "$branch"
}
stage("Compile") {
timeout(time: 15, unit: 'MINUTES') {
withMaven(
maven: mvnName,
jdk: jdk,
publisherStrategy: 'EXPLICIT',
globalMavenSettingsConfig: settingsName,
mavenOpts: mavenOpts,
mavenLocalRepo: localRepo) {
sh "mvn -V -B clean install -DskipTests -T6 -e -pl :jetty-jmh -am"
}
}
stash name: 'perf-tests', includes: jmhJarPath
}
}
// jmh run
node( 'jmh-build-node' ) {
stage("jmh-run") {
timeout( time: 210, unit: 'MINUTES' ) {
withEnv( ["JAVA_HOME=${tool "$jdk"}"] ) {
unstash name: 'perf-tests'
sh "rm -rf jmh_results"
sh "mkdir jmh_results"
sh "${env.JAVA_HOME}/bin/java -jar $jmhJarPath -rff jmh_results/jmh_result.json -rf json -foe true -i 3 -t 3 -wi 3"
jmhReport 'jmh_results/jmh_result.json'
}
}
}
}
// vim: et:ts=2:sw=2:ft=groovy