Skip to content

Commit ad66b15

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 3b080e1 commit ad66b15

File tree

1 file changed

+57
-54
lines changed

1 file changed

+57
-54
lines changed

ci/jpa-3.1-tck.Jenkinsfile

Lines changed: 57 additions & 54 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')) {
@@ -33,59 +33,62 @@ pipeline {
3333
stages {
3434
stage('Build') {
3535
steps {
36-
script {
37-
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
38-
docker.image('openjdk:11-jdk').pull()
39-
}
40-
}
41-
dir('hibernate') {
42-
checkout scm
43-
sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -DjakartaJpaVersion=3.1.0'
44-
script {
45-
env.HIBERNATE_VERSION = sh (
46-
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
47-
returnStdout: true
48-
).trim()
49-
}
50-
}
51-
dir('tck') {
52-
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/hibernate/jakarta-tck-runner.git']]]
53-
sh """ \
54-
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} .
55-
"""
56-
}
57-
}
58-
}
59-
stage('Run TCK') {
60-
steps {
61-
sh """ \
62-
rm -Rf ./results
63-
docker rm -f tck || true
64-
docker volume rm -f tck-vol || true
65-
docker volume create tck-vol
66-
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
67-
docker cp tck:/tck/persistence-tck/tmp/ ./results
68-
"""
69-
archiveArtifacts artifacts: 'results/**'
70-
script {
71-
failures = sh (
72-
script: """ \
73-
set +x
74-
while read line; do
75-
if [[ "\$line" != *"Passed." ]]; then
76-
echo "\$line"
77-
fi
78-
done <results/JTreport/text/summary.txt
79-
""",
80-
returnStdout: true
81-
).trim()
82-
if ( !failures.isEmpty() ) {
83-
echo "Some TCK tests failed:"
84-
echo failures
85-
currentBuild.result = 'FAILURE'
86-
}
87-
}
88-
}
36+
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+
55+
sh """ \
56+
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+
}
59+
}
60+
}
61+
stage('Run TCK') {
62+
steps {
63+
sh """ \
64+
rm -Rf ./results
65+
docker rm -f tck || true
66+
docker volume rm -f tck-vol || true
67+
docker volume create tck-vol
68+
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
69+
docker cp tck:/tck/persistence-tck/tmp/ ./results
70+
rm -Rf ./results/jdk-bundles
71+
"""
72+
archiveArtifacts artifacts: 'results/**'
73+
script {
74+
failures = sh (
75+
script: """ \
76+
set +x
77+
while read line; do
78+
if [[ "\$line" != *"Passed." ]]; then
79+
echo "\$line"
80+
fi
81+
done <results/JTreport/text/summary.txt
82+
""",
83+
returnStdout: true
84+
).trim()
85+
if ( !failures.isEmpty() ) {
86+
echo "Some TCK tests failed:"
87+
echo failures
88+
currentBuild.result = 'FAILURE'
89+
}
90+
}
91+
}
8992
}
9093
}
9194
post {

0 commit comments

Comments
 (0)