-
Notifications
You must be signed in to change notification settings - Fork 10
/
Jenkinsfile
64 lines (55 loc) · 1.54 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
env.project = "tcl-regex-java"
def properties = [
buildParams: [
booleanParam(
name: 'release',
defaultValue: false,
description: 'Release the project'
),
string(
name: 'version',
defaultValue: '',
description: 'Version to release, or empty to use the default next version'
),
string(
name: 'buildJdk',
defaultValue: 'openjdk-21',
description: 'The JDK to use for building',
),
string(
name: 'testJdks',
defaultValue: 'openjdk-11 openjdk-17',
description: 'The JDKs to use for tests, separated by spaces',
),
],
]
standardProperties(properties)
def afterBuildClosures = []
def buildOptions = [
mavenOptionsExtra: [jdk: params.buildJdk],
afterBuild: { afterBuildClosures.each { it() } },
]
afterBuildClosures += {
stage('sonar-report') {
withMaven() {
withSonarQubeEnv() {
sh "mvn -D sonar.login=${env.SONAR_AUTH_TOKEN} sonar:sonar -D sonar.host.url=${env.SONAR_HOST_URL}"
}
}
}
}
if (params.testJdks) {
afterBuildClosures += {
params.testJdks.split(' ').each { testJdk ->
stage("Tests in ${testJdk}") {
withMaven([
jdk: testJdk,
]) {
sh 'mvn -B -e -D enforcer.skip -D maven.javadoc.skip verify'
}
}
}
}
}
buildOptions.buildArgs = ' '
standardBuildSteps(buildOptions)