Skip to content

Commit 303c06d

Browse files
committed
Require approval for Quarkus and TCK Jenkins pipelines as well
1 parent 991f2ef commit 303c06d

File tree

2 files changed

+117
-97
lines changed

2 files changed

+117
-97
lines changed

ci/jpa-3.1-tck.Jenkinsfile

Lines changed: 72 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ if ( !env.CHANGE_ID ) {
1414
}
1515

1616
pipeline {
17-
agent {
18-
label 'LongDuration'
19-
}
17+
agent none
2018
tools {
2119
jdk 'OpenJDK 11 Latest'
2220
}
@@ -32,66 +30,78 @@ pipeline {
3230
booleanParam(name: 'NO_SLEEP', defaultValue: true, description: 'Whether the NO_SLEEP patch should be applied to speed up the TCK execution')
3331
}
3432
stages {
35-
stage('Build') {
33+
stage('Configure') {
3634
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-
}
35+
requireApprovalForPullRequest 'hibernate'
36+
}
37+
}
38+
stage('Execute') {
39+
agent {
40+
label 'LongDuration'
41+
}
42+
stages {
43+
stage('Build') {
44+
steps {
45+
script {
46+
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
47+
docker.image('openjdk:11-jdk').pull()
48+
}
49+
}
50+
dir('hibernate') {
51+
checkout scm
52+
sh './gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -DjakartaJpaVersion=3.1.0'
53+
script {
54+
env.HIBERNATE_VERSION = sh (
55+
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
56+
returnStdout: true
57+
).trim()
58+
}
59+
}
60+
dir('tck') {
61+
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/hibernate/jakarta-tck-runner.git']]]
62+
script {
63+
if ( params.TCK_URL == null || params.TCK_URL.isEmpty() ) {
64+
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} ."
65+
}
66+
else {
67+
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} ."
68+
}
69+
}
70+
}
71+
}
72+
}
73+
stage('Run TCK') {
74+
steps {
75+
sh """ \
76+
rm -Rf ./results
77+
docker rm -f tck || true
78+
docker volume rm -f tck-vol || true
79+
docker volume create tck-vol
80+
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
81+
docker cp tck:/tck/persistence-tck/tmp/ ./results
82+
"""
83+
archiveArtifacts artifacts: 'results/**'
84+
script {
85+
failures = sh (
86+
script: """ \
87+
set +x
88+
while read line; do
89+
if [[ "\$line" != *"Passed." ]]; then
90+
echo "\$line"
91+
fi
92+
done <results/JTreport/text/summary.txt
93+
""",
94+
returnStdout: true
95+
).trim()
96+
if ( !failures.isEmpty() ) {
97+
echo "Some TCK tests failed:"
98+
echo failures
99+
currentBuild.result = 'FAILURE'
100+
}
101+
}
102+
}
103+
}
104+
}
95105
}
96106
}
97107
post {

ci/quarkus.Jenkinsfile

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ if ( !env.CHANGE_ID ) {
1414
}
1515

1616
pipeline {
17-
agent {
18-
label 'LongDuration'
19-
}
17+
agent none
2018
tools {
2119
jdk 'OpenJDK 17 Latest'
2220
}
@@ -26,39 +24,51 @@ pipeline {
2624
skipDefaultCheckout()
2725
}
2826
stages {
29-
stage('Build') {
27+
stage('Configure') {
3028
steps {
31-
script {
32-
dir('hibernate') {
33-
checkout scm
34-
sh "./gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com --no-daemon -Dmaven.repo.local=${env.WORKSPACE}/.m2repository"
35-
script {
36-
env.HIBERNATE_VERSION = sh (
37-
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
38-
returnStdout: true
39-
).trim()
40-
}
41-
}
42-
dir('quarkus') {
43-
sh "git clone -b 3.15 --single-branch https://github.com/quarkusio/quarkus.git . || git reset --hard && git clean -fx && git pull"
44-
sh "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' bom/application/pom.xml"
45-
// Need to override the default maven configuration this way, because there is no other way to do it
46-
sh "sed -i 's/-Xmx5g/-Xmx2048m/' ./.mvn/jvm.config"
47-
sh "echo -e '\\n-XX:MaxMetaspaceSize=1024m'>>./.mvn/jvm.config"
48-
withMaven(mavenLocalRepo: env.WORKSPACE + '/.m2repository', publisherStrategy:'EXPLICIT') {
49-
sh "./mvnw -pl !docs -Dquickly install"
50-
// Need to kill the gradle daemons started during the Maven install run
51-
sh "sudo pkill -f '.*GradleDaemon.*' || true"
52-
// Need to override the default maven configuration this way, because there is no other way to do it
53-
sh "sed -i 's/-Xmx2048m/-Xmx1340m/' ./.mvn/jvm.config"
54-
sh "sed -i 's/MaxMetaspaceSize=1024m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
55-
def excludes = "'!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/maven,!integration-tests/quartz,!integration-tests/reactive-messaging-kafka,!integration-tests/resteasy-reactive-kotlin/standard,!integration-tests/opentelemetry-reactive-messaging,!integration-tests/virtual-threads/kafka-virtual-threads,!integration-tests/smallrye-jwt-oidc-webapp,!docs'"
56-
sh "TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED=true ./mvnw -Dinsecure.repositories=WARN -pl :quarkus-hibernate-orm -amd -pl ${excludes} verify -Dstart-containers -Dtest-containers -Dskip.gradle.build"
57-
}
58-
}
59-
}
60-
}
61-
}
29+
requireApprovalForPullRequest 'hibernate'
30+
}
31+
}
32+
stage('Execute') {
33+
agent {
34+
label 'LongDuration'
35+
}
36+
stages {
37+
stage('Build') {
38+
steps {
39+
script {
40+
dir('hibernate') {
41+
checkout scm
42+
sh "./gradlew publishToMavenLocal -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com --no-daemon -Dmaven.repo.local=${env.WORKSPACE}/.m2repository"
43+
script {
44+
env.HIBERNATE_VERSION = sh (
45+
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
46+
returnStdout: true
47+
).trim()
48+
}
49+
}
50+
dir('quarkus') {
51+
sh "git clone -b 3.15 --single-branch https://github.com/quarkusio/quarkus.git . || git reset --hard && git clean -fx && git pull"
52+
sh "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' bom/application/pom.xml"
53+
// Need to override the default maven configuration this way, because there is no other way to do it
54+
sh "sed -i 's/-Xmx5g/-Xmx2048m/' ./.mvn/jvm.config"
55+
sh "echo -e '\\n-XX:MaxMetaspaceSize=1024m'>>./.mvn/jvm.config"
56+
withMaven(mavenLocalRepo: env.WORKSPACE + '/.m2repository', publisherStrategy:'EXPLICIT') {
57+
sh "./mvnw -pl !docs -Dquickly install"
58+
// Need to kill the gradle daemons started during the Maven install run
59+
sh "sudo pkill -f '.*GradleDaemon.*' || true"
60+
// Need to override the default maven configuration this way, because there is no other way to do it
61+
sh "sed -i 's/-Xmx2048m/-Xmx1340m/' ./.mvn/jvm.config"
62+
sh "sed -i 's/MaxMetaspaceSize=1024m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
63+
def excludes = "'!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/maven,!integration-tests/quartz,!integration-tests/reactive-messaging-kafka,!integration-tests/resteasy-reactive-kotlin/standard,!integration-tests/opentelemetry-reactive-messaging,!integration-tests/virtual-threads/kafka-virtual-threads,!integration-tests/smallrye-jwt-oidc-webapp,!docs'"
64+
sh "TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED=true ./mvnw -Dinsecure.repositories=WARN -pl :quarkus-hibernate-orm -amd -pl ${excludes} verify -Dstart-containers -Dtest-containers -Dskip.gradle.build"
65+
}
66+
}
67+
}
68+
}
69+
}
70+
}
71+
}
6272
}
6373
post {
6474
always {

0 commit comments

Comments
 (0)