9
9
/*
10
10
* See https://github.com/hibernate/hibernate-jenkins-pipeline-helpers
11
11
*/
12
- @Library (' hibernate-jenkins-pipeline-helpers@1.14 ' ) _
12
+ @Library (' hibernate-jenkins-pipeline-helpers@1.17 ' ) _
13
13
14
14
import org.hibernate.jenkins.pipeline.helpers.version.Version
15
15
@@ -48,8 +48,8 @@ if ( !manualRelease && !RELEASE_ON_PUSH ) {
48
48
def checkoutReleaseScripts () {
49
49
dir(' .release/scripts' ) {
50
50
checkout scmGit(branches : [[name : ' */main' ]], extensions : [],
51
- userRemoteConfigs : [[credentialsId : ' ed25519.Hibernate-CI.github.com' ,
52
- url : ' https://github.com/hibernate/hibernate-release-scripts.git' ]])
51
+ userRemoteConfigs : [[credentialsId : ' ed25519.Hibernate-CI.github.com' ,
52
+ url : ' https://github.com/hibernate/hibernate-release-scripts.git' ]])
53
53
}
54
54
}
55
55
@@ -107,11 +107,11 @@ pipeline {
107
107
echo " Release was requested manually"
108
108
109
109
if ( ! params. RELEASE_VERSION ) {
110
- throw new IllegalArgumentException ( ' Missing value for parameter RELEASE_VERSION. This parameter must be set explicitly to prevent mistakes.' )
110
+ throw new IllegalArgumentException ( ' Missing value for parameter RELEASE_VERSION. This parameter must be set explicitly to prevent mistakes.' )
111
111
}
112
112
releaseVersion = Version . parseReleaseVersion( params. RELEASE_VERSION )
113
113
114
- if ( releaseVersion. toString(). startsWith( currentVersion. family + ' .' ) ) {
114
+ if ( ! releaseVersion. toString(). startsWith( currentVersion. family + ' .' ) ) {
115
115
throw new IllegalArgumentException ( " RELEASE_VERSION = $releaseVersion , which is different from the family of CURRENT_VERSION = $currentVersion . Did you make a mistake?" )
116
116
}
117
117
}
@@ -147,12 +147,10 @@ pipeline {
147
147
148
148
env. RELEASE_VERSION = releaseVersion. toString()
149
149
env. DEVELOPMENT_VERSION = developmentVersion. toString()
150
- def versionBasis = releaseVersion. unqualified
151
-
152
150
env. SCRIPT_OPTIONS = params. RELEASE_DRY_RUN ? " -d" : " "
153
151
154
152
// Determine version id to check if Jira version exists
155
- sh " .release/scripts/determine-jira-version-id.sh ${ env.JIRA_KEY} ${ versionBasis } "
153
+ sh " .release/scripts/determine-jira-version-id.sh ${ env.JIRA_KEY} ${ releaseVersion.withoutFinalQualifier } "
156
154
}
157
155
}
158
156
}
@@ -166,17 +164,23 @@ pipeline {
166
164
configFile(fileId : ' release.config.ssh.knownhosts' , targetLocation : " ${ env.HOME} /.ssh/known_hosts" )
167
165
]) {
168
166
withCredentials([
169
- usernamePassword(credentialsId : ' ossrh.sonatype.org' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USER' ),
170
- usernamePassword(credentialsId : ' gradle-plugin-portal-api-key' , passwordVariable : ' PLUGIN_PORTAL_PASSWORD' , usernameVariable : ' PLUGIN_PORTAL_USERNAME' ),
171
- file(credentialsId : ' release.gpg.private-key' , variable : ' RELEASE_GPG_PRIVATE_KEY_PATH' ),
172
- string(credentialsId : ' release.gpg.passphrase' , variable : ' RELEASE_GPG_PASSPHRASE' )
167
+ usernamePassword(credentialsId : ' ossrh.sonatype.org' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USER' ),
168
+ usernamePassword(credentialsId : ' gradle-plugin-portal-api-key' , passwordVariable : ' PLUGIN_PORTAL_PASSWORD' , usernameVariable : ' PLUGIN_PORTAL_USERNAME' ),
169
+ file(credentialsId : ' release.gpg.private-key' , variable : ' RELEASE_GPG_PRIVATE_KEY_PATH' ),
170
+ string(credentialsId : ' release.gpg.passphrase' , variable : ' RELEASE_GPG_PASSPHRASE' )
173
171
]) {
174
172
sshagent([' ed25519.Hibernate-CI.github.com' , ' hibernate.filemgmt.jboss.org' , ' hibernate-ci.frs.sourceforge.net' ]) {
175
173
// set release version
176
174
// update changelog from JIRA
177
175
// tags the version
178
176
// changes the version to the provided development version
179
- sh " .release/scripts/prepare-release.sh ${ env.PROJECT} ${ env.RELEASE_VERSION} ${ env.DEVELOPMENT_VERSION} "
177
+ withEnv([
178
+ " BRANCH=${ env.GIT_BRANCH} " ,
179
+ // Increase the amount of memory for this part since asciidoctor doc rendering consumes a lot of metaspace
180
+ " 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'"
181
+ ]) {
182
+ sh " .release/scripts/prepare-release.sh ${ env.PROJECT} ${ env.RELEASE_VERSION} ${ env.DEVELOPMENT_VERSION} "
183
+ }
180
184
}
181
185
}
182
186
}
@@ -193,16 +197,16 @@ pipeline {
193
197
configFile(fileId : ' release.config.ssh.knownhosts' , targetLocation : " ${ env.HOME} /.ssh/known_hosts" )
194
198
]) {
195
199
withCredentials([
196
- usernamePassword(credentialsId : ' ossrh.sonatype.org' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USER' ),
197
- usernamePassword(credentialsId : ' gradle-plugin-portal-api-key' , passwordVariable : ' PLUGIN_PORTAL_PASSWORD' , usernameVariable : ' PLUGIN_PORTAL_USERNAME' ),
198
- file(credentialsId : ' release.gpg.private-key' , variable : ' RELEASE_GPG_PRIVATE_KEY_PATH' ),
199
- string(credentialsId : ' release.gpg.passphrase' , variable : ' RELEASE_GPG_PASSPHRASE' ),
200
- gitUsernamePassword(credentialsId : ' username-and-token.Hibernate-CI.github.com' , gitToolName : ' Default' )
200
+ usernamePassword(credentialsId : ' ossrh.sonatype.org' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USER' ),
201
+ usernamePassword(credentialsId : ' gradle-plugin-portal-api-key' , passwordVariable : ' PLUGIN_PORTAL_PASSWORD' , usernameVariable : ' PLUGIN_PORTAL_USERNAME' ),
202
+ file(credentialsId : ' release.gpg.private-key' , variable : ' RELEASE_GPG_PRIVATE_KEY_PATH' ),
203
+ string(credentialsId : ' release.gpg.passphrase' , variable : ' RELEASE_GPG_PASSPHRASE' ),
204
+ gitUsernamePassword(credentialsId : ' username-and-token.Hibernate-CI.github.com' , gitToolName : ' Default' )
201
205
]) {
202
206
sshagent([' ed25519.Hibernate-CI.github.com' , ' hibernate.filemgmt.jboss.org' , ' hibernate-ci.frs.sourceforge.net' ]) {
203
207
// performs documentation upload and Sonatype release
204
208
// push to github
205
- sh " .release/scripts/publish.sh ${ env.SCRIPT_OPTIONS} ${ env.PROJECT} ${ env.RELEASE_VERSION} ${ env.DEVELOPMENT_VERSION} "
209
+ sh " .release/scripts/publish.sh ${ env.SCRIPT_OPTIONS} ${ env.PROJECT} ${ env.RELEASE_VERSION} ${ env.DEVELOPMENT_VERSION} ${ env.GIT_BRANCH } "
206
210
}
207
211
}
208
212
}
@@ -247,11 +251,11 @@ pipeline {
247
251
}
248
252
}
249
253
}
250
- post {
251
- always {
252
- configFileProvider([configFile(fileId : ' job-configuration.yaml' , variable : ' JOB_CONFIGURATION_FILE' )]) {
253
- notifyBuildResult maintainers : (String ) readYaml(file : env. JOB_CONFIGURATION_FILE ). notification?. email?. recipients
254
- }
255
- }
256
- }
254
+ post {
255
+ always {
256
+ configFileProvider([configFile(fileId : ' job-configuration.yaml' , variable : ' JOB_CONFIGURATION_FILE' )]) {
257
+ notifyBuildResult maintainers : (String ) readYaml(file : env. JOB_CONFIGURATION_FILE ). notification?. email?. recipients
258
+ }
259
+ }
260
+ }
257
261
}
0 commit comments