Skip to content

Commit ae2db6b

Browse files
marko-bekhtabeikov
authored andcommitted
Add Quarkus testing to the 7.1 branch
1 parent a26e667 commit ae2db6b

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

ci/quarkus.Jenkinsfile

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
@Library('hibernate-jenkins-pipeline-helpers') _
2+
3+
// Avoid running the pipeline on branch indexing
4+
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
5+
print "INFO: Build skipped due to trigger being Branch Indexing"
6+
currentBuild.result = 'NOT_BUILT'
7+
return
8+
}
9+
// This is a limited maintenance branch, so don't run this on pushes to the branch, only on PRs
10+
if ( !env.CHANGE_ID ) {
11+
print "INFO: Build skipped because this job should only run for pull request, not for branch pushes"
12+
currentBuild.result = 'NOT_BUILT'
13+
return
14+
}
15+
16+
pipeline {
17+
agent none
18+
tools {
19+
jdk 'OpenJDK 21 Latest'
20+
maven 'Apache Maven 3.9'
21+
}
22+
options {
23+
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
24+
disableConcurrentBuilds(abortPrevious: true)
25+
skipDefaultCheckout()
26+
}
27+
stages {
28+
stage('Checks') {
29+
steps {
30+
requireApprovalForPullRequest 'hibernate'
31+
}
32+
}
33+
stage('Build') {
34+
agent {
35+
label 'LongDuration'
36+
}
37+
steps {
38+
script {
39+
dir('hibernate') {
40+
checkout scm
41+
sh "./gradlew clean publishToMavenLocal -x test --no-scan --no-daemon --no-build-cache --stacktrace -PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com -Dmaven.repo.local=${env.WORKSPACE}/.m2repository"
42+
script {
43+
env.HIBERNATE_VERSION = sh (
44+
script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
45+
returnStdout: true
46+
).trim()
47+
}
48+
}
49+
dir('quarkus') {
50+
def quarkusVersionToTest = '3.27'
51+
sh "git clone -b ${quarkusVersionToTest} --single-branch https://github.com/quarkusio/quarkus.git . || git reset --hard && git clean -fx && git pull"
52+
script {
53+
def sedStatus = sh (script: "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' pom.xml", returnStatus: true)
54+
if ( sedStatus != 0 ) {
55+
throw new IllegalArgumentException( "Unable to replace hibernate version in Quarkus pom. Got exit code $sedStatus" )
56+
}
57+
}
58+
// Need to override the default maven configuration this way, because there is no other way to do it
59+
sh "sed -i 's/-Xmx5g/-Xmx2048m/' ./.mvn/jvm.config"
60+
sh "echo -e '\\n-XX:MaxMetaspaceSize=1024m'>>./.mvn/jvm.config"
61+
withMaven(mavenLocalRepo: env.WORKSPACE + '/.m2repository', publisherStrategy: 'EXPLICIT') {
62+
// to account for script-only maven wrapper use in Quarkus:
63+
withEnv(["MAVEN_ARGS=${env.MAVEN_ARGS?:""} ${env.MAVEN_CONFIG}"]) {
64+
sh "./mvnw -pl !docs -Dquickly install"
65+
// Need to kill the gradle daemons started during the Maven install run
66+
sh "sudo pkill -f '.*GradleDaemon.*' || true"
67+
// Need to override the default maven configuration this way, because there is no other way to do it
68+
sh "sed -i 's/-Xmx2048m/-Xmx1340m/' ./.mvn/jvm.config"
69+
sh "sed -i 's/MaxMetaspaceSize=1024m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
70+
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,!extensions/oidc-db-token-state-manager/deployment,!docs'"
71+
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"
72+
}
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
79+
post {
80+
always {
81+
notifyBuildResult maintainers: "andrea@hibernate.org steve@hibernate.org christian.beikov@gmail.com mbellade@redhat.com"
82+
}
83+
}
84+
}

0 commit comments

Comments
 (0)