11#! /usr/bin/groovy
22/*
3- * Hibernate, Relational Persistence for Idiomatic Java
4- *
5- * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
6- * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
3+ * SPDX-License-Identifier: Apache-2.0
4+ * Copyright Red Hat Inc. and Hibernate Authors
75 */
86
97/*
@@ -89,9 +87,13 @@ pipeline {
8987 )
9088 }
9189 stages {
92- stage(' Release check ' ) {
90+ stage(' Check ' ) {
9391 steps {
9492 script {
93+ print " INFO: params.RELEASE_VERSION = ${ params.RELEASE_VERSION} "
94+ print " INFO: params.DEVELOPMENT_VERSION = ${ params.DEVELOPMENT_VERSION} "
95+ print " INFO: params.RELEASE_DRY_RUN? = ${ params.RELEASE_DRY_RUN} "
96+
9597 checkoutReleaseScripts()
9698
9799 def currentVersion = Version . parseDevelopmentVersion( sh(
@@ -107,7 +109,9 @@ pipeline {
107109 echo " Release was requested manually"
108110
109111 if ( ! params. RELEASE_VERSION ) {
110- throw new IllegalArgumentException ( ' Missing value for parameter RELEASE_VERSION. This parameter must be set explicitly to prevent mistakes.' )
112+ throw new IllegalArgumentException (
113+ ' Missing value for parameter RELEASE_VERSION. This parameter must be set explicitly to prevent mistakes.'
114+ )
111115 }
112116 releaseVersion = Version . parseReleaseVersion( params. RELEASE_VERSION )
113117
@@ -149,17 +153,12 @@ pipeline {
149153
150154 env. RELEASE_VERSION = releaseVersion. toString()
151155 env. DEVELOPMENT_VERSION = developmentVersion. toString()
152- // Dry run is not supported at the moment
153- env. SCRIPT_OPTIONS = params. RELEASE_DRY_RUN ? " -d" : " "
156+ env. SCRIPT_OPTIONS = params. RELEASE_DRY_RUN ? " -d" : " "
154157 env. JRELEASER_DRY_RUN = params. RELEASE_DRY_RUN
155-
156- // Determine version id to check if Jira version exists
157- // This step doesn't work for Hibernate Reactive (the project has been created with a different type on JIRA)
158- // sh ".release/scripts/determine-jira-version-id.sh ${env.JIRA_KEY} ${releaseVersion.withoutFinalQualifier}"
159158 }
160159 }
161160 }
162- stage(' Release prepare ' ) {
161+ stage(' Prepare ' ) {
163162 steps {
164163 script {
165164 checkoutReleaseScripts()
@@ -168,13 +167,13 @@ pipeline {
168167 configFile(fileId : ' release.config.ssh' , targetLocation : " ${ env.HOME} /.ssh/config" ),
169168 configFile(fileId : ' release.config.ssh.knownhosts' , targetLocation : " ${ env.HOME} /.ssh/known_hosts" )
170169 ]) {
171-
172- sshagent([' ed25519.Hibernate-CI.github.com' , ' hibernate.filemgmt.jboss.org' , ' hibernate-ci.frs.sourceforge.net' ]) {
170+ sshagent([' ed25519.Hibernate-CI.github.com' , ' hibernate.filemgmt.jboss.org' , ' hibernate-ci.frs.sourceforge.net' ]) {
173171 // set release version
174172 // update changelog from JIRA
175173 // tags the version
176174 // changes the version to the provided development version
177175 withEnv([
176+ " DISABLE_REMOTE_GRADLE_CACHE=true" ,
178177 // Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
179178 " GRADLE_OPTS=-Dorg.gradle.jvmargs='-Dlog4j2.disableJmx -Xmx4g -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Duser.language=en -Duser.country=US -Duser.timezone=UTC -Dfile.encoding=UTF-8'"
180179 ]) {
@@ -185,7 +184,7 @@ pipeline {
185184 }
186185 }
187186 }
188- stage(' Publish release ' ) {
187+ stage(' Publish' ) {
189188 steps {
190189 script {
191190 checkoutReleaseScripts()
@@ -195,16 +194,20 @@ pipeline {
195194 configFile(fileId : ' release.config.ssh.knownhosts' , targetLocation : " ${ env.HOME} /.ssh/known_hosts" )
196195 ]) {
197196 withCredentials([
198- usernamePassword(credentialsId : ' central.sonatype.com' , passwordVariable : ' JRELEASER_MAVENCENTRAL_TOKEN' , usernameVariable : ' JRELEASER_MAVENCENTRAL_USERNAME' ),
199- gitUsernamePassword(credentialsId : ' username-and-token.Hibernate-CI.github.com' , gitToolName : ' Default' ),
200- file(credentialsId : ' release.gpg.private-key' , variable : ' RELEASE_GPG_PRIVATE_KEY_PATH' ),
201- string(credentialsId : ' release.gpg.passphrase' , variable : ' JRELEASER_GPG_PASSPHRASE' ),
202- string(credentialsId : ' Hibernate-CI.github.com' , variable : ' JRELEASER_GITHUB_TOKEN' )
197+ usernamePassword(credentialsId : ' central.sonatype.com' , passwordVariable : ' JRELEASER_MAVENCENTRAL_TOKEN' , usernameVariable : ' JRELEASER_MAVENCENTRAL_USERNAME' ),
198+ gitUsernamePassword(credentialsId : ' username-and-token.Hibernate-CI.github.com' , gitToolName : ' Default' ),
199+ file(credentialsId : ' release.gpg.private-key' , variable : ' RELEASE_GPG_PRIVATE_KEY_PATH' ),
200+ string(credentialsId : ' release.gpg.passphrase' , variable : ' JRELEASER_GPG_PASSPHRASE' ),
201+ string(credentialsId : ' Hibernate-CI.github.com' , variable : ' JRELEASER_GITHUB_TOKEN' )
203202 ]) {
204203 sshagent([' ed25519.Hibernate-CI.github.com' , ' hibernate.filemgmt.jboss.org' , ' hibernate-ci.frs.sourceforge.net' ]) {
205204 // performs documentation upload and Sonatype release
206205 // push to github
207- sh " .release/scripts/publish.sh -j ${ env.SCRIPT_OPTIONS} ${ env.PROJECT} ${ env.RELEASE_VERSION} ${ env.DEVELOPMENT_VERSION} ${ env.GIT_BRANCH} "
206+ withEnv([
207+ " DISABLE_REMOTE_GRADLE_CACHE=true"
208+ ]) {
209+ sh " .release/scripts/publish.sh -j ${ env.SCRIPT_OPTIONS} ${ env.PROJECT} ${ env.RELEASE_VERSION} ${ env.DEVELOPMENT_VERSION} ${ env.GIT_BRANCH} "
210+ }
208211 }
209212 }
210213 }
0 commit comments