forked from jetty-project/tck-run
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile_websocket
More file actions
93 lines (83 loc) · 4.37 KB
/
Copy pathJenkinsfile_websocket
File metadata and controls
93 lines (83 loc) · 4.37 KB
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
def branch = params.JETTY_BRANCH ?: "jetty-10.0.x"
def jdk = params.JDK ?: "jdk11"
def jettyVersion = ""
node('linux'){
stage("cleanup"){
sh "rm -rf *"
}
stage("Checkout TCK Run") {
git url: "https://github.com/jetty-project/tck-run.git", branch: "master"
stash name: 'wsts.jte', includes: 'wsts.jte'
stash name: 'log4j2.xml', includes: 'log4j2.xml'
}
stage("Checkout Jetty") {
git url: "https://github.com/eclipse/jetty.project.git", branch: "$branch"
}
stage("Build Jetty") {
timeout(time: 30, unit: 'MINUTES') {
withMaven(
maven: 'maven3',
jdk: "$jdk",
publisherStrategy: 'EXPLICIT',
globalMavenSettingsConfig: 'oss-settings.xml',
mavenOpts: '-Xms1g -Xmx4g',
mavenLocalRepo: ".repository") {
pom = readMavenPom file: 'pom.xml'
jettyVersion = pom.version
sh "mvn -V -B -pl jetty-home -am clean install -DskipTests -T6 -e"
}
}
}
stage("Setup servlet tck"){
env.JAVA_HOME="${tool "$jdk"}"
env.PATH="${env.JAVA_HOME}/bin:${env.PATH}"
//sh "wget https://jenkins.webtide.net/userContent/websockettck-1.1_latest.zip"
sh "wget -O websockettck.zip http://download.eclipse.org/ee4j/jakartaee-tck/jakartaee8/nightly-802/websocket-tck-1.1.1.zip"
sh "unzip websockettck.zip"
sh "mv websocket-tck websockettck"
sh "ls -lrt"
sh "cd jetty-home/target/ && mkdir jetty-base"
sh "cd jetty-home/target/jetty-base && java -jar ../jetty-home/start.jar --approve-all-licenses --create-startd --add-to-start=resources,server,http,webapp,deploy,annotations,jsp,websocket,logging-log4j2"
sh 'find websockettck -name *.war -exec cp {} jetty-home/target/jetty-base/webapps/ \\;'
unstash name: 'wsts.jte'
// replace values in ts.jte
def text = readFile "wsts.jte"
text = text.replaceAll("@WORKSPACE@", "${env.WORKSPACE}")
text = text.replaceAll("@JETTY_VERSION@", jettyVersion)
writeFile file:"websockettck/bin/ts.jte", text: text
sh "cat websockettck/bin/ts.jte"
unstash name: 'log4j2.xml'
sh "cp log4j2.xml jetty-home/target/jetty-base/resources/"
//sh "wget -O realm.ini https://raw.githubusercontent.com/jetty-project/tck-run/master/realm.ini"
//sh "cp realm.ini jetty-distribution/target/jetty-base/start.d"
//sh "wget -O realm.properties https://github.com/jetty-project/tck-run/raw/master/realm.properties"
//sh "cp realm.properties jetty-distribution/target/jetty-base/etc"
//sh "wget -O test-realm.xml https://github.com/jetty-project/tck-run/raw/master/test-realm.xml"
//sh "cp test-realm.xml jetty-distribution/target/jetty-base/etc"
//sh "wget -O cacerts.jks https://github.com/jetty-project/tck-run/raw/master/cacerts.jks"
//sh "cp cacerts.jks servlettck/bin/certificates"
//sh "cp cacerts.jks jetty-distribution/target/jetty-base/etc"
//sh "wget -O clientcert.jks https://github.com/jetty-project/tck-run/raw/master/clientcert.jks"
//sh "cp clientcert.jks servlettck/bin/certificates"
//sh "cp clientcert.jks jetty-distribution/target/jetty-base/etc"
//sh "cd jetty-distribution/target/jetty-base && java -Duser.language=en -Duser.country=US -Djavax.net.ssl.trustStore=etc/cacerts.jks -Djavax.net.ssl.keyStore=etc/clientcert.jks -Djavax.net.ssl.keyStorePassword=changeit -jar ../distribution/start.jar jetty.sslContext.trustStorePath=etc/cacerts.jks &"
sh "cd jetty-home/target/jetty-base && java -Duser.language=en -Duser.country=US -jar ../jetty-home/start.jar &"
}
stage("run websocket tck"){
try {
timeout( time: 3, unit: 'HOURS' ) {
withAnt(installation: 'ant-latest', jdk: "$jdk") {
sh "cd websockettck/bin && ant run.all"
}
}
} catch(Throwable e){
e.printStackTrace();
}
tckreporttojunit tckReportTxtPath: "${env.WORKSPACE}/JTReport/text/summary.txt", junitFolderPath: 'surefire-reports'
junit testResults: '**/surefire-reports/*.xml'
currentBuild.description = "Build branch $branch with jdk $jdk"
archiveArtifacts artifacts: "${env.WORKSPACE}/JTReport/text/*.txt",allowEmptyArchive: true
archiveArtifacts artifacts: "jetty-home/target/jetty-base/logs/*.*",allowEmptyArchive: true
publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/JTReport/html", reportFiles: 'report.html', reportName: 'TCK Report', reportTitles: ''])
}
}