@@ -15,11 +15,10 @@ import org.hibernate.jenkins.pipeline.helpers.version.Version
15
15
// Global build configuration
16
16
env. PROJECT = " reactive"
17
17
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 .
19
19
20
20
print " INFO: env.PROJECT = ${ env.PROJECT} "
21
21
print " INFO: env.JIRA_KEY = ${ env.JIRA_KEY} "
22
- print " INFO: RELEASE_ON_PUSH = ${ RELEASE_ON_PUSH} "
23
22
24
23
// --------------------------------------------
25
24
// Build conditions
@@ -32,10 +31,17 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
32
31
}
33
32
34
33
def manualRelease = currentBuild. getBuildCauses(). toString(). contains( ' UserIdCause' )
34
+ def cronRelease = currentBuild. getBuildCauses(). toString(). contains( ' TimerTriggerCause' )
35
35
36
36
// 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"
39
45
currentBuild. result = ' NOT_BUILT'
40
46
return
41
47
}
@@ -51,19 +57,23 @@ def checkoutReleaseScripts() {
51
57
}
52
58
}
53
59
60
+
54
61
// --------------------------------------------
55
62
// Pipeline
56
63
57
64
pipeline {
58
65
agent {
59
66
label ' Release'
60
67
}
68
+ triggers {
69
+ // Run every week Sunday 1 AM
70
+ cron(' 0 1 * * 0' )
71
+ }
61
72
tools {
62
73
jdk ' OpenJDK 17 Latest'
63
74
}
64
75
options {
65
76
buildDiscarder logRotator(daysToKeepStr : ' 30' , numToKeepStr : ' 10' )
66
- rateLimitBuilds(throttle : [count : 1 , durationName : ' day' , userBoost : true ])
67
77
disableConcurrentBuilds(abortPrevious : false )
68
78
preserveStashes()
69
79
}
0 commit comments