forked from apache/cxf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
161 lines (144 loc) · 6.92 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
pipeline {
agent {
label 'ubuntu'
}
tools {
ant 'Ant 1.10.6'
maven 'Maven 3.6.2'
jdk 'JDK 1.8.0_241'
}
environment {
ANT_OPTS = "-Djavax.xml.accessExternalSchema=all"
}
stages {
stage("Initialization") {
steps {
buildName "#${BUILD_NUMBER} CXF ${params.Version} JAX-RS 2.1 TCK"
}
}
stage("Prepare") {
steps {
cleanWs()
}
}
stage ('Check tooling') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
echo "JAVA_HOME = ${JAVA_HOME}"
echo "ANT_HOME = ${ANT_HOME}"
echo "WORKSPACE = ${PWD}"
'''
}
}
stage('Download JakartaEE TCK') {
steps {
checkout([$class: 'GitSCM',
branches: [[name: 'refs/tags/8.0.0']],
userRemoteConfigs: [[url: 'https://github.com/eclipse-ee4j/jakartaee-tck']],
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'jakartaee-tck']]
])
}
}
stage('Download Glassfish 5.1.0') { // for display purposes
steps {
sh 'wget https://repo1.maven.org/maven2/org/glassfish/main/distributions/glassfish/5.1.0/glassfish-5.1.0.zip'
sh 'unzip glassfish-5.1.0.zip'
sh 'rm glassfish-5.1.0.zip'
}
}
stage('Download Apache CXF bits') {
steps {
echo "Using Apache CXF version: " + params.Version
sh "mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=https://repository.apache.org/snapshots,https://repository.apache.org -Dartifact=org.apache.cxf:cxf-core:${params.Version}:jar -Dtransitive=false -Ddest=glassfish5/glassfish/lib"
sh "mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=https://repository.apache.org/snapshots,https://repository.apache.org -Dartifact=org.apache.cxf:cxf-rt-frontend-jaxrs:${params.Version}:jar -Dtransitive=false -Ddest=glassfish5/glassfish/lib"
sh "mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=https://repository.apache.org/snapshots,https://repository.apache.org -Dartifact=org.apache.cxf:cxf-rt-rs-client:${params.Version}:jar -Dtransitive=false -Ddest=glassfish5/glassfish/lib"
sh "mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=https://repository.apache.org/snapshots,https://repository.apache.org -Dartifact=org.apache.cxf:cxf-rt-rs-sse:${params.Version}:jar -Dtransitive=false -Ddest=glassfish5/glassfish/lib"
sh "mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=https://repository.apache.org/snapshots,https://repository.apache.org -Dartifact=org.apache.cxf:cxf-rt-transports-http:${params.Version}:jar -Dtransitive=false -Ddest=glassfish5/glassfish/lib"
echo "Including additional dependencies (woodstox, ...)"
sh "mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:get -DremoteRepositories=https://repository.apache.org/snapshots,https://repository.apache.org -Dartifact=com.fasterxml.woodstox:woodstox-core:5.2.1:jar -Dtransitive=false -Ddest=glassfish5/glassfish/lib"
}
}
stage('Prepare JAX-RS TCK build configuration') {
steps {
withEnv(["WORKSPACE = ${PWD}"]) {
sh "wget https://raw.githubusercontent.com/apache/cxf/master/tck/ts.jte.template"
sh "sed -i '" + 's/${version}/' + params.Version + "/g' ts.jte.template"
sh "sed -i '" + 's#${GF_HOME}#' + "${WORKSPACE}/glassfish5/glassfish" + "#g' ts.jte.template"
sh "cp jakartaee-tck/bin/xml/impl/glassfish/jersey.xml jakartaee-tck/bin/xml/impl/glassfish/cxf.xml"
}
}
}
stage('Build JAX-RS TCK') {
steps {
withEnv([
"WORKSPACE=${pwd()}",
"TS_HOME=${WORKSPACE}/jakartaee-tck",
"javaee_home=${WORKSPACE}/glassfish5",
"GF_HOME=${WORKSPACE}/glassfish5/glassfish",
"AS_JAVA=$JAVA_HOME",
"deliverabledir=jaxrs"
]) {
sh 'yes | cp -vr ts.jte.template jakartaee-tck/install/jaxrs/bin/ts.jte'
dir("${TS_HOME}/install/${deliverabledir}/bin") {
sh "ant build.all"
sh "ant update.jaxrs.wars"
}
dir("${TS_HOME}/release/tools/") {
sh "ant jaxrs"
}
}
}
}
stage('Run JAX-RS TCK') {
steps {
withEnv([
"WORKSPACE=${pwd()}",
"TS_HOME=${WORKSPACE}/restful-ws-tck",
"javaee_home=${WORKSPACE}/glassfish5",
"GF_HOME=${WORKSPACE}/glassfish5/glassfish",
"AS_JAVA=$JAVA_HOME",
"deliverabledir=jaxrs"
]) {
sh "cp -r jakartaee-tck/release/JAXRS_BUILD/latest/restful-ws-tck ${WORKSPACE}"
sh "yes | cp -vr ts.jte.template ${TS_HOME}/bin/ts.jte"
dir("${TS_HOME}/bin") {
sh "ant config.vi"
sh "ant deploy.all"
script {
try {
echo 'Running all TCK tests ...'
sh "ant run.all"
} catch (exc) {
echo 'Some TCK tests have failed, marking build as unstable'
currentBuild.result = 'UNSTABLE'
}
}
}
}
}
post {
always {
withEnv([
"WORKSPACE=${pwd()}",
"TS_HOME=${WORKSPACE}/restful-ws-tck",
]) {
dir("${TS_HOME}/bin") {
sh "ant stop-server -f xml/impl/glassfish/config.vi.xml"
}
sh "mv /tmp/JT* ${WORKSPACE}"
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'jakartaee-tck/release/JAXRS_BUILD/latest/restful*.zip', fingerprint: true
archiveArtifacts artifacts: 'JTwork/**', fingerprint: true
archiveArtifacts artifacts: 'JTreport/**', fingerprint: true
cleanWs()
}
}
}