1+ import groovy.transform.Field
2+
13@Library('hibernate-jenkins-pipeline-helpers') _
24
5+ @Field final String ORM_JDK_VERSION = '21'
6+ @Field final String QUARKUS_JDK_VERSION = '17'
7+ @Field final String ORM_JDK_TOOL = "OpenJDK ${ORM_JDK_VERSION} Latest"
8+ @Field final String QUARKUS_JDK_TOOL = "OpenJDK ${QUARKUS_JDK_VERSION} Latest"
9+
310// Avoid running the pipeline on branch indexing
411if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
512 print "INFO: Build skipped due to trigger being Branch Indexing"
@@ -61,22 +68,18 @@ class BuildConfiguration {
6168
6269// See data category from https://github.com/quarkusio/quarkus/blob/main/.github/native-tests.json
6370def configurations = [
64- new BuildConfiguration( name: "JVM test", projects: "!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/hibernate-search-orm-elasticsearch-outbox-polling,!integration-tests/hibernate-search-orm-elasticsearch-tenancy,!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",
65- new BuildConfiguration( name: "Data1", nativeProfile: true, projects: "jpa-h2, jpa-h2-embedded, jpa-mariadb, jpa-mssql, jpa-without-entity, hibernate-orm-tenancy/datasource, hibernate-orm-tenancy/connection-resolver, hibernate-orm-tenancy/connection-resolver-legacy-qualifiers",
66- new BuildConfiguration( name: "Data2", nativeProfile: true, projects: "jpa, jpa-mapping-xml/legacy-app, jpa-mapping-xml/modern-app, jpa-mysql, jpa-db2, jpa-oracle",
67- new BuildConfiguration( name: "Data3", nativeProfile: true, projects: "flyway, hibernate-orm-panache, hibernate-orm-panache-kotlin, hibernate-orm-envers, liquibase, liquibase-mongodb",
68- new BuildConfiguration( name: "Data4", nativeProfile: true, projects: "mongodb-client, mongodb-devservices, mongodb-panache, mongodb-rest-data-panache, mongodb-panache-kotlin, redis-client, hibernate-orm-rest-data-panache",
69- new BuildConfiguration( name: "Data5", nativeProfile: true, projects: "jpa-postgresql, jpa-postgresql-withxml, narayana-stm, narayana-jta, reactive-pg-client, hibernate-reactive-postgresql, hibernate-orm-tenancy/schema, hibernate-orm-tenancy/schema-mariadb",
70- new BuildConfiguration( name: "Data6", nativeProfile: true, projects: "elasticsearch-rest-client, elasticsearch-java-client, hibernate-search-orm-elasticsearch, hibernate-search-orm-elasticsearch-tenancy, hibernate-search-orm-opensearch, hibernate-search-orm-elasticsearch-outbox-polling, hibernate-search-standalone-elasticsearch, hibernate-search-standalone-opensearch",
71- new BuildConfiguration( name: "Data7", nativeProfile: true, projects: "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mariadb, hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal-flyway, hibernate-reactive-panache, hibernate-reactive-panache-kotlin, hibernate-reactive-oracle"
71+ new BuildConfiguration( name: "JVM test", projects: "!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/hibernate-search-orm-elasticsearch-outbox-polling,!integration-tests/hibernate-search-orm-elasticsearch-tenancy,!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") ,
72+ new BuildConfiguration( name: "Data1", nativeProfile: true, projects: "jpa-h2, jpa-h2-embedded, jpa-mariadb, jpa-mssql, jpa-without-entity, hibernate-orm-tenancy/datasource, hibernate-orm-tenancy/connection-resolver, hibernate-orm-tenancy/connection-resolver-legacy-qualifiers") ,
73+ new BuildConfiguration( name: "Data2", nativeProfile: true, projects: "jpa, jpa-mapping-xml/legacy-app, jpa-mapping-xml/modern-app, jpa-mysql, jpa-db2, jpa-oracle") ,
74+ new BuildConfiguration( name: "Data3", nativeProfile: true, projects: "flyway, hibernate-orm-panache, hibernate-orm-panache-kotlin, hibernate-orm-envers, liquibase, liquibase-mongodb") ,
75+ new BuildConfiguration( name: "Data4", nativeProfile: true, projects: "mongodb-client, mongodb-devservices, mongodb-panache, mongodb-rest-data-panache, mongodb-panache-kotlin, redis-client, hibernate-orm-rest-data-panache") ,
76+ new BuildConfiguration( name: "Data5", nativeProfile: true, projects: "jpa-postgresql, jpa-postgresql-withxml, narayana-stm, narayana-jta, reactive-pg-client, hibernate-reactive-postgresql, hibernate-orm-tenancy/schema, hibernate-orm-tenancy/schema-mariadb") ,
77+ new BuildConfiguration( name: "Data6", nativeProfile: true, projects: "elasticsearch-rest-client, elasticsearch-java-client, hibernate-search-orm-elasticsearch, hibernate-search-orm-elasticsearch-tenancy, hibernate-search-orm-opensearch, hibernate-search-orm-elasticsearch-outbox-polling, hibernate-search-standalone-elasticsearch, hibernate-search-standalone-opensearch") ,
78+ new BuildConfiguration( name: "Data7", nativeProfile: true, projects: "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mariadb, hibernate-reactive-mssql, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal-flyway, hibernate-reactive-panache, hibernate-reactive-panache-kotlin, hibernate-reactive-oracle")
7279]
7380
7481pipeline {
7582 agent none
76- tools {
77- jdk 'OpenJDK 21 Latest'
78- maven 'Apache Maven 3.9'
79- }
8083 options {
8184 buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
8285 disableConcurrentBuilds(abortPrevious: true)
@@ -88,34 +91,49 @@ pipeline {
8891 requireApprovalForPullRequest 'hibernate'
8992 }
9093 }
91- stage('Build') {
94+ stage('Build Hibernate ORM') {
95+ agent {
96+ label 'LongDuration'
97+ }
98+ tools {
99+ jdk ORM_JDK_TOOL
100+ }
92101 steps {
93- stage('Build Hibernate ORM') {
94- agent {
95- label 'LongDuration'
96- }
97- script {
98- dir('hibernate') {
99- checkout scm
100- 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"
101- script {
102- env.HIBERNATE_VERSION = sh (
103- script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
104- returnStdout: true
105- ).trim()
106- }
102+ script {
103+ dir('hibernate') {
104+ checkout scm
105+ 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_TMP}/.m2repository"
106+ script {
107+ env.HIBERNATE_VERSION = sh (
108+ script: "grep hibernateVersion gradle/version.properties|cut -d'=' -f2",
109+ returnStdout: true
110+ ).trim()
107111 }
108112 }
109- }
110- stage('Build Quarkus') {
111- agent {
112- label 'LongDuration'
113+ dir(env.WORKSPACE_TMP) {
114+ stash name: 'repository', includes: ".m2repository/"
113115 }
114- script {
115- Map<String, Closure> executions = [:]
116+ }
117+ }
118+ }
119+ stage('Build Quarkus') {
120+ agent {
121+ label 'LongDuration'
122+ }
123+ tools {
124+ jdk QUARKUS_JDK_TOOL
125+ maven 'Apache Maven 3.9'
126+ }
127+ steps {
128+ script {
129+ Map<String, Closure> executions = [:]
116130
117- configurations.each { BuildConfiguration configuration ->
118- executions.put(configuration.name, {
131+ configurations.each { BuildConfiguration configuration ->
132+ executions.put(configuration.name, {
133+ node( 'LongDuration' ) {
134+ dir(env.WORKSPACE_TMP) {
135+ unstash "repository"
136+ }
119137 dir('quarkus') {
120138 def quarkusVersionToTest = 'orm-7-1-10-3.27'
121139 sh "git clone -b ${quarkusVersionToTest} --single-branch https://github.com/yrodiere/quarkus.git . || git reset --hard && git clean -fx && git pull"
@@ -128,16 +146,17 @@ pipeline {
128146 // Need to override the default maven configuration this way, because there is no other way to do it
129147 sh "sed -i 's/-Xmx5g/-Xmx2048m/' ./.mvn/jvm.config"
130148 sh "echo -e '\\n-XX:MaxMetaspaceSize=1024m'>>./.mvn/jvm.config"
131- withMaven(mavenLocalRepo: env.WORKSPACE + '/.m2repository', publisherStrategy: 'EXPLICIT') {
149+ withMaven(mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository', publisherStrategy: 'EXPLICIT') {
150+ def javaHome = tool(name: QUARKUS_JDK_TOOL, type: 'jdk')
132151 // to account for script-only maven wrapper use in Quarkus:
133- withEnv(["MAVEN_ARGS=${env.MAVEN_ARGS?:""} ${env.MAVEN_CONFIG}"]) {
152+ withEnv(["JAVA_HOME=${javaHome}", "PATH+JAVA=${javaHome}/bin", " MAVEN_ARGS=${env.MAVEN_ARGS?:""} ${env.MAVEN_CONFIG}"]) {
134153 sh "./mvnw -pl !docs -Dquickly install"
135154 // Need to kill the gradle daemons started during the Maven install run
136155 sh "sudo pkill -f '.*GradleDaemon.*' || true"
137156 // Need to override the default maven configuration this way, because there is no other way to do it
138157 sh "sed -i 's/-Xmx2048m/-Xmx1340m/' ./.mvn/jvm.config"
139158 sh "sed -i 's/MaxMetaspaceSize=1024m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
140- def projects = configuration.projects.join(", ")
159+ def projects = configuration.projects
141160 def additionalArguments
142161 def additionalOptions
143162 if ( configuration.nativeProfile ) {
@@ -152,10 +171,10 @@ pipeline {
152171 }
153172 }
154173 }
155- })
156- }
157- parallel executions
174+ }
175+ })
158176 }
177+ parallel executions
159178 }
160179 }
161180 }
0 commit comments