Skip to content

Commit 741679e

Browse files
committed
Limit disk usage of TCK reports
We don't need to keep a copy of the whole JDK around in the reports of every single build... Note this is only necessary in the 3.1 TCK, as the 3.2 TCK doesn't seem to do that anymore.
1 parent e9f22fb commit 741679e

File tree

1 file changed

+62
-59
lines changed

1 file changed

+62
-59
lines changed

ci/jpa-3.1-tck.Jenkinsfile

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Library('hibernate-jenkins-pipeline-helpers@1.5') _
1+
@Library('hibernate-jenkins-pipeline-helpers') _
22

33
// Avoid running the pipeline on branch indexing
44
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
@@ -34,64 +34,67 @@ pipeline {
3434
stages {
3535
stage('Build') {
3636
steps {
37-
script {
38-
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
39-
docker.image('openjdk:11-jdk').pull()
40-
}
41-
}
42-
dir('hibernate') {
43-
checkout scm
44-
sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -DjakartaJpaVersion=3.1.0'
45-
script {
46-
env.HIBERNATE_VERSION = sh (
47-
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
48-
returnStdout: true
49-
).trim()
50-
}
51-
}
52-
dir('tck') {
53-
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/hibernate/jakarta-tck-runner.git']]]
54-
script {
55-
if ( params.TCK_URL == null || params.TCK_URL.isEmpty() ) {
56-
sh "cd jpa-3.1; docker build -f Dockerfile.${params.IMAGE_JDK} -t jakarta-tck-runner --build-arg TCK_VERSION=${params.TCK_VERSION} --build-arg TCK_SHA=${params.TCK_SHA} ."
57-
}
58-
else {
59-
sh "cd jpa-3.1; docker build -f Dockerfile.${params.IMAGE_JDK} -t jakarta-tck-runner --build-arg TCK_VERSION=${params.TCK_VERSION} --build-arg TCK_SHA=${params.TCK_SHA} --build-arg TCK_URL=${params.TCK_URL} ."
60-
}
61-
}
62-
}
63-
}
64-
}
65-
stage('Run TCK') {
66-
steps {
67-
sh """ \
68-
rm -Rf ./results
69-
docker rm -f tck || true
70-
docker volume rm -f tck-vol || true
71-
docker volume create tck-vol
72-
docker run -v ~/.m2/repository/org/hibernate:/root/.m2/repository/org/hibernate:z -v tck-vol:/tck/persistence-tck/tmp/:z -e NO_SLEEP=${params.NO_SLEEP} -e HIBERNATE_VERSION=$HIBERNATE_VERSION --name tck jakarta-tck-runner
73-
docker cp tck:/tck/persistence-tck/tmp/ ./results
74-
"""
75-
archiveArtifacts artifacts: 'results/**'
76-
script {
77-
failures = sh (
78-
script: """ \
79-
set +x
80-
while read line; do
81-
if [[ "\$line" != *"Passed." ]]; then
82-
echo "\$line"
83-
fi
84-
done <results/JTreport/text/summary.txt
85-
""",
86-
returnStdout: true
87-
).trim()
88-
if ( !failures.isEmpty() ) {
89-
echo "Some TCK tests failed:"
90-
echo failures
91-
currentBuild.result = 'FAILURE'
92-
}
93-
}
94-
}
37+
38+
script {
39+
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
40+
docker.image('openjdk:11-jdk').pull()
41+
}
42+
}
43+
dir('hibernate') {
44+
checkout scm
45+
sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -DjakartaJpaVersion=3.1.0'
46+
script {
47+
env.HIBERNATE_VERSION = sh (
48+
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
49+
returnStdout: true
50+
).trim()
51+
}
52+
}
53+
dir('tck') {
54+
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/hibernate/jakarta-tck-runner.git']]]
55+
script {
56+
if ( params.TCK_URL == null || params.TCK_URL.isEmpty() ) {
57+
sh "cd jpa-3.1; docker build -f Dockerfile.${params.IMAGE_JDK} -t jakarta-tck-runner --build-arg TCK_VERSION=${params.TCK_VERSION} --build-arg TCK_SHA=${params.TCK_SHA} ."
58+
}
59+
else {
60+
sh "cd jpa-3.1; docker build -f Dockerfile.${params.IMAGE_JDK} -t jakarta-tck-runner --build-arg TCK_VERSION=${params.TCK_VERSION} --build-arg TCK_SHA=${params.TCK_SHA} --build-arg TCK_URL=${params.TCK_URL} ."
61+
}
62+
}
63+
}
64+
}
65+
}
66+
stage('Run TCK') {
67+
steps {
68+
sh """ \
69+
rm -Rf ./results
70+
docker rm -f tck || true
71+
docker volume rm -f tck-vol || true
72+
docker volume create tck-vol
73+
docker run -v ~/.m2/repository/org/hibernate:/root/.m2/repository/org/hibernate:z -v tck-vol:/tck/persistence-tck/tmp/:z -e NO_SLEEP=${params.NO_SLEEP} -e HIBERNATE_VERSION=$HIBERNATE_VERSION --name tck jakarta-tck-runner
74+
docker cp tck:/tck/persistence-tck/tmp/ ./results
75+
rm -Rf ./results/jdk-bundles
76+
"""
77+
archiveArtifacts artifacts: 'results/**'
78+
script {
79+
failures = sh (
80+
script: """ \
81+
set +x
82+
while read line; do
83+
if [[ "\$line" != *"Passed." ]]; then
84+
echo "\$line"
85+
fi
86+
done <results/JTreport/text/summary.txt
87+
""",
88+
returnStdout: true
89+
).trim()
90+
if ( !failures.isEmpty() ) {
91+
echo "Some TCK tests failed:"
92+
echo failures
93+
currentBuild.result = 'FAILURE'
94+
}
95+
}
96+
}
97+
9598
}
9699
}
97100
post {

0 commit comments

Comments
 (0)