HHH-17239 Automate maintenance releases

This commit is contained in:
Christian Beikov 2023-10-05 00:44:02 +02:00
parent db2c5e1386
commit 3b3ed55e5a
1 changed files with 10 additions and 14 deletions

View File

@ -57,6 +57,15 @@ pipeline {
stage('Release check') { stage('Release check') {
steps { steps {
script { script {
// Avoid doing a release for commits from a release
def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true)
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true)
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
print "INFO: Build skipped because last commits were for the previous release"
currentBuild.result = 'ABORTED'
return
}
dir('.release/scripts') { dir('.release/scripts') {
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']]) checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
} }
@ -132,19 +141,6 @@ pipeline {
} }
} }
} }
// Done through Jira Automation
// stage('Jira release') {
// steps {
// script {
// dir('.release/scripts') {
// checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
// }
// withCredentials([usernameColonPassword(credentialsId: 'jira-automation', variable: 'JIRA_API_TOKEN')]) {
// sh ".release/scripts/jira-release.sh ${env.SCRIPT_OPTIONS} ${env.JIRA_KEY} ${env.VERSION_BASIS} ${env.NEXT_VERSION_BASIS}"
// }
// }
// }
// }
stage('Publish release') { stage('Publish release') {
steps { steps {
script { script {
@ -186,7 +182,7 @@ pipeline {
extensions: [], extensions: [],
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']] userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
) )
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.VERSION_BASIS}" sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
} }
} }
} }