-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile.tckbuild
113 lines (106 loc) · 5.98 KB
/
Jenkinsfile.tckbuild
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
#!groovy
pipeline {
agent { node { label 'linux' } }
parameters {
string( defaultValue: 'jdk11', description: 'JDK to build TCK (use jdk11)', name: 'JDKTCK' )
string( defaultValue: 'master', description: 'GIT branch name to build (master/8.0/servlet_jakarta/xxx)',
name: 'TCK_BRANCH' )
choice(
description: 'Github org',
name: 'GITHUB_ORG',
choices: ['jakartaee','olamy']
)
choice(
description: 'TCK servlet job to run',
name: 'TCK_TO_RUN',
choices: ['servlettck-run-12.0.x-ee10', 'servlettck-run-12.0.x-ee9',
'servlettck-run-jetty-10.0.x','servlettck-run-jetty-11.0.x',
'servlettck-run-jetty-10.0.x_tck_8_0_branch','websocket/websockettck-run-jetty-11.0.x',
'websocket/websockettck-run-jetty-10.0.x',
'jsp/jsptck-run-jetty-11.0.x','jsp/jsptck-run-jetty-10.0.x']
)
string( defaultValue: "jetty-12.0.x",
description: 'Jetty 12.0.x branch to build',
name: 'JETTY_BRANCH' )
string( defaultValue: '6.0.0',
description: 'tck servlet version',
name: 'TCK_SERVLET_VERSION')
string( defaultValue: 'https://ci.eclipse.org/jakartaee-tck/job/build-glassfish/lastSuccessfulBuild/artifact/appserver/distributions/glassfish/target/glassfish.zip',
description: 'URL to download Glassfish bundle (https://jenkins.webtide.net/userContent/glassfish-5.1.0.zip)',
name: 'GLASSFISH_BUNDLE_URL' )
}
stages {
stage("cleanup"){
steps {
sh "rm -rf *"
}
}
stage("Checkout TCK Run") {
steps {
//git url: 'https://github.com/${GITHUB_ORG}/jakartaee-tck/', branch: '${TCK_BRANCH}'
checkout([$class: 'GitSCM',
branches: [[name: "*/${TCK_BRANCH}"]],
extensions: [[$class: 'CloneOption', depth: 1, noTags: true, shallow: true]],
userRemoteConfigs: [[url: 'https://github.com/${GITHUB_ORG}/jakartaee-tck/']]])
}
}
stage("Build TCK Servlet") {
steps {
withEnv(["JAVA_HOME=${ tool "${JDKTCK}" }",
"PATH+ANT+MAVEN=${tool 'ant-latest'}/bin:${env.JAVA_HOME}/bin:${tool 'maven3'}/bin",
"GF_BUNDLE_URL=${GLASSFISH_BUNDLE_URL}"]) {
sh "apt --yes update && apt --yes install zip"
sh "bash docker/build_standalone-tcks.sh servlet"
sh "bash docker/build_standalone-tcks.sh websocket"
sh "bash docker/build_standalone-tcks.sh jsp"
//sh "bash docker/build_standalone-tcks.sh el"
//sh "bash docker/build_standalone-tcks.sh jstl"
archiveArtifacts artifacts: "standalone-bundles/*.zip",allowEmptyArchive: true
}
script{
currentBuild.description = "Build TCK from $GITHUB_ORG/$TCK_BRANCH"
}
}
}
stage("Schedule TCK run") {
steps {
script {
if (TCK_TO_RUN) {
//TCK_URL = "$JENKINS_URL/job/$JOB_NAME/$BUILD_NUMBER/artifact/standalone-bundles/servlet-tck-4.0.0.zip"
TCK_URL = "$BUILD_URL/artifact/standalone-bundles/servlet-tck-${TCK_SERVLET_VERSION}.zip"
TCK_SVLT_JAKARTA_URL = "$BUILD_URL/artifact/standalone-bundles/servlet-tck-${TCK_SERVLET_VERSION}.zip"
TCK_WS_URL = "$BUILD_URL/artifact/standalone-bundles/websocket-tck-2.0.0.zip"
TCK_JSP_URL = "$BUILD_URL/artifact/standalone-bundles/pages-tck-2.3.0.zip"
TCK_JSP_JAKARTA_URL = "$BUILD_URL/artifact/standalone-bundles/pages-tck-3.0.0.zip"
TCK_EL_URL = "$BUILD_URL/artifact/standalone-bundles/expression-language-tck-4.0.0.zip"
TCK_JSTL_URL = "$BUILD_URL/artifact/standalone-bundles/tags-tck-1.2.0.zip"
echo "tckurl: $TCK_URL"
def built = build job: "$TCK_TO_RUN", parameters: [string(name: 'TCKURL', value: "$TCK_URL"),
string(name: 'JETTY_BRANCH', value: "$JETTY_BRANCH"),
string(name: 'TCK_WS_URL', value: "$TCK_WS_URL"),
string(name: 'TCK_JSP_URL', value: "$TCK_JSP_URL"),
string(name: 'TCK_EL_URL', value: "$TCK_EL_URL"),
string(name: 'TCK_JSTL_URL', value: "$TCK_JSTL_URL"),
string(name: 'TCK_SVLT_JAKARTA_URL', value: "$TCK_SVLT_JAKARTA_URL"),
string(name: 'TCK_JSP_JAKARTA_URL', value: "$TCK_JSP_JAKARTA_URL"),
string(name: 'TCKBUILD', value: "$GITHUB_ORG/$TCK_BRANCH")]
copyArtifacts(projectName: "$TCK_TO_RUN", selector: specific("${built.number}"));
}
}
}
post {
always {
tckreporttojunit tckReportTxtPath: "${env.WORKSPACE}/JTReport/text/summary.txt", junitFolderPath: 'surefire-reports'
junit testResults: '**/surefire-reports/*.xml'
script{
currentBuild.description = "Run TCK branch ${JETTY_BRANCH}"
}
archiveArtifacts artifacts: "**/surefire-reports/*.xml",allowEmptyArchive: true
archiveArtifacts artifacts: "JTReport/**",allowEmptyArchive: true
archiveArtifacts artifacts: "jetty-home/target/jetty-base/logs/*.*",allowEmptyArchive: true
publishHTML([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/JTReport/html", reportFiles: 'report.html', reportName: 'TCK Report', reportTitles: ''])
}
}
}
}
}