-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile.servlet-12.0.x-ee8
81 lines (78 loc) · 3.15 KB
/
Jenkinsfile.servlet-12.0.x-ee8
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
pipeline {
agent any
triggers {
//cron ('H */12 * * *')
cron '@daily'
}
options {
buildDiscarder logRotator( numToKeepStr: '50' )
}
parameters {
string( defaultValue: "https://download.eclipse.org/jakartaee/servlet/4.0/jakarta-servlet-tck-4.0.0.zip",
description: 'Url to download TCK () do not change anything if you are not sure :)',
name: 'TCK_SVLT_JAKARTA_URL' )
string( defaultValue: "jetty-12.0.x",
description: 'Jetty 12.0.x branch to build',
name: 'JETTY_BRANCH' )
string( defaultValue: 'jdk17', description: 'JDK to build Jetty', name: 'JDKBUILD' )
string( defaultValue: 'jdk8', description: 'JDK to run TCK (use jdk8)', name: 'JDKTCK' )
}
stages {
stage( 'Tck Run' ) {
steps {
script{
def built = build( job: 'servlettck-run-12.0.x', propagate: false,
parameters: [string( name: 'JETTY_BRANCH', value: "${JETTY_BRANCH}" ),
string( name: 'JDKBUILD', value: "${JDKBUILD}" ),
string( name: 'JDKTCK', value: "${JDKTCK}" ),
string( name: 'TCKURL', value: "${TCK_SVLT_JAKARTA_URL}" ),
string( name: 'TCKURL', value: "${TCK_SVLT_JAKARTA_URL}" ),
string( name: 'EEX', value: 'ee8' )] )
copyArtifacts(projectName: 'servlettck-run-12.0.x', selector: specific("${built.number}"));
}
//unarchive mapping: ['**/**' : '.']
}
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: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: "${env.WORKSPACE}/JTReport/html", reportFiles: 'report.html', reportName: 'TCK Report', reportTitles: ''])
}
failure {
slackNotif()
}
unstable {
slackNotif()
}
fixed {
slackNotif()
}
}
}
}
}
def slackNotif() {
script {
if(true) {
return
}
try
{
//BUILD_USER = currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
// by ${BUILD_USER}
COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
slackSend channel: '#jenkins',
color: COLOR_MAP[currentBuild.currentResult],
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} - ${env.BUILD_URL}"
} catch (Exception e) {
e.printStackTrace()
echo "skip failure slack notification: " + e.getMessage()
}
}
}