HHH-17239 Automate maintenance releases

This commit is contained in:
Christian Beikov 2023-10-05 00:44:02 +02:00
parent 991dd4add2
commit 5cdebfa59e
1 changed files with 10 additions and 14 deletions

View File

@ -57,6 +57,15 @@ pipeline {
stage('Release check') {
steps {
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') {
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') {
steps {
script {
@ -186,7 +182,7 @@ pipeline {
extensions: [],
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}"
}
}
}