-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
134 lines (120 loc) · 5.78 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
126
127
128
129
130
131
132
133
134
#!groovy
pipeline {
agent { node { label 'linux' } }
options {
buildDiscarder logRotator( numToKeepStr: '50' )
}
parameters {
choice(
description: 'TCK Github org',
name: 'GITHUB_ORG_TCK',
choices: ['jakartaee', 'olamy']
)
string( defaultValue: 'main', description: 'GIT branch name to build TCK (master/tckrefactor)',
name: 'TCK_BRANCH' )
choice(
description: 'Arquillian Github org',
name: 'GITHUB_ORG_ARQUILLIAN',
choices: ['arquillian','olamy'] )
string( defaultValue: 'master', description: 'GIT branch name to build arquillian Jetty (master/tck-all-changes)',
name: 'ARQUILLIAN_JETTY_BRANCH' )
string( defaultValue: 'jetty-12.0.x', description: 'GIT branch name to build Jetty (jetty-12.0.x)',
name: 'JETTY_BRANCH' )
string( defaultValue: 'SNAPSHOT', description: 'Jetty Version',
name: 'JETTY_VERSION' )
string( defaultValue: 'jdk17', description: 'JDK to build Jetty', name: 'JDKBUILD' )
}
stages {
//stage('Build External') {
//parallel {
stage("Checkout Build Jetty 12.0.x") {
steps {
ws('jetty') {
deleteDir()
checkout([$class: 'GitSCM',
branches: [[name: "*/$JETTY_BRANCH"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true, reference: "/home/jenkins/jetty.project.git"]],
userRemoteConfigs: [[url: 'https://github.com/eclipse/jetty.project.git']]])
timeout(time: 45, unit: 'MINUTES') {
withEnv(["JAVA_HOME=${tool "$JDKBUILD"}",
"PATH+MAVEN=${env.JAVA_HOME}/bin:${tool 'maven3'}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider([configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -ntp -s $GLOBAL_MVN_SETTINGS -V -B -U clean install -T5 -e -DskipTests -Dmaven.build.cache.restoreGeneratedSources=false -Dmaven.build.cache.remote.url=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-build-cache -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=nexus-cred"
script {
if (JETTY_VERSION == "SNAPSHOT") {
def model = readMavenPom file: 'pom.xml'
JETTY_VERSION = model.getVersion()
}
}
}
}
}
}
}
}
stage("Checkout Build Arquillian Jetty") {
steps {
ws('arquillian') {
deleteDir()
checkout([$class: 'GitSCM',
branches: [[name: "*/$ARQUILLIAN_JETTY_BRANCH"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/${GITHUB_ORG_ARQUILLIAN}/arquillian-container-jetty']]])
timeout(time: 30, unit: 'MINUTES') {
withEnv(["JAVA_HOME=${tool "$JDKBUILD"}",
"PATH+MAVEN=${env.JAVA_HOME}/bin:${tool "maven3"}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider([configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -ntp -s $GLOBAL_MVN_SETTINGS -V -B -U clean install -DskipTests -T3 -e -Denforcer.skip=true"
}
}
}
}
}
}
//}
//}
stage("Checkout Build TCK Sources") {
steps {
ws('arquillian') {
deleteDir()
checkout([$class: 'GitSCM',
branches: [[name: "*/$TCK_BRANCH"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/${GITHUB_ORG_TCK}/platform-tck']]])
timeout(time: 30, unit: 'MINUTES') {
withEnv(["JAVA_HOME=${tool "$JDKBUILD"}",
"PATH+MAVEN=${env.JAVA_HOME}/bin:${tool "maven3"}/bin",
"MAVEN_OPTS=-Xms2g -Xmx4g -Djava.awt.headless=true"]) {
configFileProvider([configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -ntp install:install-file -Dfile=./lib/javatest.jar -DgroupId=javatest -DartifactId=javatest -Dversion=5.0 -Dpackaging=jar"
// TCK should be changed to always install
// -Dmaven.build.cache.remote.url=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-build-cache -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=nexus-cred
sh "mvn -ntp -s $GLOBAL_MVN_SETTINGS -V -B -U -am clean install -DskipTests -e"
}
}
}
}
}
}
stage("Run TCK") {
steps {
timeout(time: 90, unit: 'MINUTES') {
withEnv(["JAVA_HOME=${tool "$JDKBUILD"}",
"PATH+MAVEN=${env.JAVA_HOME}/bin:${tool "maven3"}/bin",
"MAVEN_OPTS=-Xms4g -Xmx8g -Djava.awt.headless=true"]) {
configFileProvider([configFile(fileId: 'oss-settings.xml', variable: 'GLOBAL_MVN_SETTINGS')]) {
sh "mvn -nsu -ntp -s $GLOBAL_MVN_SETTINGS -Dmaven.test.failure.ignore=true -V -B -U clean verify -e -Djetty.version=$JETTY_VERSION"
}
}
}
}
post {
always {
junit testResults: '**/failsafe-reports/TEST-**.xml'
}
}
}
}
}