From 3b3ed55e5a0b529b9127419aa4645f30fdcf8ee2 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Thu, 5 Oct 2023 00:44:02 +0200 Subject: [PATCH] HHH-17239 Automate maintenance releases --- ci/release/Jenkinsfile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index f46d5b73bf..2b56e3f5cc 100644 --- a/ci/release/Jenkinsfile +++ b/ci/release/Jenkinsfile @@ -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}" } } }