-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
140 lines (124 loc) · 6.04 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
135
136
137
138
139
140
#!groovy
pipeline {
agent { node { label 'linux' } }
tools {
maven 'maven3'
}
// triggers {
// upstream(upstreamProjects: 'tck/tck-olamy-github-tck-run-module-glassfish') //, threshold: hudson.model.Result.SUCCESS)
// }
options {
buildDiscarder logRotator( numToKeepStr: '50' )
}
parameters {
string( defaultValue: '6.1.x', description: 'GIT branch name to build TCK (master/tck)',
name: 'TCK_BRANCH' )
choice( description: 'TCK Github org',
name: 'GITHUB_ORG_TCK',
choices: ['jakartaee','olamy','jetty-project','markt-asf'])
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' )
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: 'jdk17', description: 'JDK to build Jetty', name: 'JDKBUILD' )
string( defaultValue: '', description: 'Extra Maven Args', name: 'MVN_ARGS' )
}
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 {
echo "Before eval JETTY_VERSION $JETTY_VERSION"
if (JETTY_VERSION == "SNAPSHOT") {
def model = readMavenPom file: 'pom.xml'
JETTY_VERSION = model.getVersion()
echo "Read JETTY_VERSION $JETTY_VERSION"
}
}
}
}
}
}
}
}
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('tck') {
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}/servlet']]])
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"
sh "mvn -ntp -s $GLOBAL_MVN_SETTINGS -V -B clean install -e -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"
}
}
}
}
}
}
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 $MVN_ARGS"
}
}
}
}
post {
always {
junit testResults: '**/surefire-reports/TEST-**.xml'
}
}
}
}
}