Skip to content

Commit 3b3ed55

Browse files
committed
HHH-17239 Automate maintenance releases
1 parent db2c5e1 commit 3b3ed55

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

ci/release/Jenkinsfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ pipeline {
5757
stage('Release check') {
5858
steps {
5959
script {
60+
// Avoid doing a release for commits from a release
61+
def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true)
62+
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true)
63+
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
64+
print "INFO: Build skipped because last commits were for the previous release"
65+
currentBuild.result = 'ABORTED'
66+
return
67+
}
68+
6069
dir('.release/scripts') {
6170
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
6271
}
@@ -132,19 +141,6 @@ pipeline {
132141
}
133142
}
134143
}
135-
// Done through Jira Automation
136-
// stage('Jira release') {
137-
// steps {
138-
// script {
139-
// dir('.release/scripts') {
140-
// checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate-release-scripts.git']])
141-
// }
142-
// withCredentials([usernameColonPassword(credentialsId: 'jira-automation', variable: 'JIRA_API_TOKEN')]) {
143-
// sh ".release/scripts/jira-release.sh ${env.SCRIPT_OPTIONS} ${env.JIRA_KEY} ${env.VERSION_BASIS} ${env.NEXT_VERSION_BASIS}"
144-
// }
145-
// }
146-
// }
147-
// }
148144
stage('Publish release') {
149145
steps {
150146
script {
@@ -186,7 +182,7 @@ pipeline {
186182
extensions: [],
187183
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
188184
)
189-
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.VERSION_BASIS}"
185+
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
190186
}
191187
}
192188
}

0 commit comments

Comments
 (0)