1
1
#! /usr/bin/groovy
2
2
/*
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
7
5
*/
8
6
9
7
/*
@@ -89,9 +87,13 @@ pipeline {
89
87
)
90
88
}
91
89
stages {
92
- stage(' Release check ' ) {
90
+ stage(' Check ' ) {
93
91
steps {
94
92
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
+
95
97
checkoutReleaseScripts()
96
98
97
99
def currentVersion = Version . parseDevelopmentVersion( sh(
@@ -107,7 +109,9 @@ pipeline {
107
109
echo " Release was requested manually"
108
110
109
111
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
+ )
111
115
}
112
116
releaseVersion = Version . parseReleaseVersion( params. RELEASE_VERSION )
113
117
@@ -149,17 +153,12 @@ pipeline {
149
153
150
154
env. RELEASE_VERSION = releaseVersion. toString()
151
155
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" : " "
154
157
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}"
159
158
}
160
159
}
161
160
}
162
- stage(' Release prepare ' ) {
161
+ stage(' Prepare ' ) {
163
162
steps {
164
163
script {
165
164
checkoutReleaseScripts()
@@ -168,13 +167,13 @@ pipeline {
168
167
configFile(fileId : ' release.config.ssh' , targetLocation : " ${ env.HOME} /.ssh/config" ),
169
168
configFile(fileId : ' release.config.ssh.knownhosts' , targetLocation : " ${ env.HOME} /.ssh/known_hosts" )
170
169
]) {
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' ]) {
173
171
// set release version
174
172
// update changelog from JIRA
175
173
// tags the version
176
174
// changes the version to the provided development version
177
175
withEnv([
176
+ " DISABLE_REMOTE_GRADLE_CACHE=true" ,
178
177
// Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
179
178
" 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'"
180
179
]) {
@@ -185,7 +184,7 @@ pipeline {
185
184
}
186
185
}
187
186
}
188
- stage(' Publish release ' ) {
187
+ stage(' Publish' ) {
189
188
steps {
190
189
script {
191
190
checkoutReleaseScripts()
@@ -195,16 +194,20 @@ pipeline {
195
194
configFile(fileId : ' release.config.ssh.knownhosts' , targetLocation : " ${ env.HOME} /.ssh/known_hosts" )
196
195
]) {
197
196
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' )
203
202
]) {
204
203
sshagent([' ed25519.Hibernate-CI.github.com' , ' hibernate.filemgmt.jboss.org' , ' hibernate-ci.frs.sourceforge.net' ]) {
205
204
// performs documentation upload and Sonatype release
206
205
// 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
+ }
208
211
}
209
212
}
210
213
}
0 commit comments