-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile.cometd-snapshot
61 lines (58 loc) · 1.64 KB
/
Jenkinsfile.cometd-snapshot
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
#!groovy
pipeline {
agent { node { label 'linux' } }
triggers {
cron '@daily'
}
tools {
maven 'maven3'
}
options {
buildDiscarder logRotator( numToKeepStr: '5' )
}
stages {
stage("Cometd 5.0.x"){
steps{
buildIt("jetty-9.4.x", "5.0.x", "jdk11")
}
}
stage("Cometd 6.0.x"){
steps{
buildIt("jetty-10.0.x", "6.0.x", "jdk11")
}
}
stage("Cometd 7.0.x"){
steps{
buildIt("jetty-11.0.x", "7.0.x", "jdk17")
}
}
}
}
def buildIt(jettyBranch, cometdBranch, jdk){
sh "wget -q -O $jettyBranch https://raw.githubusercontent.com/eclipse/jetty.project/$jettyBranch/pom.xml"
script {
def model = readMavenPom file: "$jettyBranch"
jetty_version = model.getVersion()
}
echo "Jetty version $jetty_version"
checkout([$class: 'GitSCM',
branches: [[name: "*/$cometdBranch"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/cometd/cometd.git']]])
script {
try {
withEnv(["JAVA_HOME=${ tool "$jdk" }",
"PATH+MAVEN=${ tool "$jdk" }/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider(
[configFile(fileId: 'oss-deploy', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -T2 --no-transfer-progress -s $GLOBAL_MVN_SETTINGS -Djetty.version=$jetty_version -Pci -V -B -e clean install"
}
}
}
finally
{
junit testResults: '**/target/surefire-reports/*.xml,**/target/invoker-reports/TEST*.xml', allowEmptyResults: true
}
}
}