Skip to content

Commit 978860f

Browse files
yrodierebeikov
authored andcommitted
Release Jenkinsfile: explicitly skip automatic releases for non-maintenance branches
1 parent 5f0fbc4 commit 978860f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ci/release/Jenkinsfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,18 @@ pipeline {
9595
else {
9696
echo "Release was triggered automatically"
9797

98-
// Avoid doing a release for commits from a release
98+
// Avoid doing an automatic release on a non-maintenance branch
99+
if ( ! ( env.BRANCH_NAME ==~ /^\d+\.\d+$/ ) ) {
100+
print "INFO: Automatic release skipped because the branch name doesn't follow pattern /^\\d+\\.\\d+\$/"
101+
currentBuild.result = 'ABORTED'
102+
return
103+
}
104+
105+
// Avoid doing an automatic release for commits from a release
99106
def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true)
100107
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true)
101108
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
102-
print "INFO: Build skipped because last commits were for the previous release"
109+
print "INFO: Automatic release skipped because last commits were for the previous release"
103110
currentBuild.result = 'ABORTED'
104111
return
105112
}

0 commit comments

Comments
 (0)