Skip to content

Commit 53f7e6d

Browse files
committed
Release job: code for weekly release (disabled for now)
1 parent 5c40b45 commit 53f7e6d

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

ci/release/Jenkinsfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ import org.hibernate.jenkins.pipeline.helpers.version.Version
1515
// Global build configuration
1616
env.PROJECT = "reactive"
1717
env.JIRA_KEY = "HREACT"
18-
def RELEASE_ON_PUSH = false // Set to `true` *only* on branches where you want a release on each push.
18+
def RELEASE_ON_SCHEDULE = false // Set to `true` *only* on branches where you want a scheduled release.
1919

2020
print "INFO: env.PROJECT = ${env.PROJECT}"
2121
print "INFO: env.JIRA_KEY = ${env.JIRA_KEY}"
22-
print "INFO: RELEASE_ON_PUSH = ${RELEASE_ON_PUSH}"
2322

2423
// --------------------------------------------
2524
// Build conditions
@@ -32,10 +31,17 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
3231
}
3332

3433
def manualRelease = currentBuild.getBuildCauses().toString().contains( 'UserIdCause' )
34+
def cronRelease = currentBuild.getBuildCauses().toString().contains( 'TimerTriggerCause' )
3535

3636
// Only do automatic release on branches where we opted in
37-
if ( !manualRelease && !RELEASE_ON_PUSH ) {
38-
print "INFO: Build skipped because automated releases are disabled on this branch. See constant RELEASE_ON_PUSH in ci/release/Jenkinsfile"
37+
if ( !manualRelease && !cronRelease ) {
38+
print "INFO: Build skipped because automated releases on push are disabled on this branch."
39+
currentBuild.result = 'NOT_BUILT'
40+
return
41+
}
42+
43+
if ( !manualRelease && cronRelease && !RELEASE_ON_SCHEDULE ) {
44+
print "INFO: Build skipped because automated releases are disabled on this branch. See constant RELEASE_ON_SCHEDULE in ci/release/Jenkinsfile"
3945
currentBuild.result = 'NOT_BUILT'
4046
return
4147
}
@@ -51,19 +57,23 @@ def checkoutReleaseScripts() {
5157
}
5258
}
5359

60+
5461
// --------------------------------------------
5562
// Pipeline
5663

5764
pipeline {
5865
agent {
5966
label 'Release'
6067
}
68+
triggers {
69+
// Run every week Sunday 1 AM
70+
cron('0 1 * * 0')
71+
}
6172
tools {
6273
jdk 'OpenJDK 17 Latest'
6374
}
6475
options {
6576
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
66-
rateLimitBuilds(throttle: [count: 1, durationName: 'day', userBoost: true])
6777
disableConcurrentBuilds(abortPrevious: false)
6878
preserveStashes()
6979
}

0 commit comments

Comments
 (0)