@@ -17,11 +17,10 @@ import org.hibernate.jenkins.pipeline.helpers.version.Version
17
17
// Global build configuration
18
18
env. PROJECT = " orm"
19
19
env. JIRA_KEY = " HHH"
20
- def RELEASE_ON_PUSH = true // Set to `true` *only* on branches where you want a release on each push .
20
+ def RELEASE_ON_SCHEDULE = true // Set to `true` *only* on branches where you want a scheduled release .
21
21
22
22
print " INFO: env.PROJECT = ${ env.PROJECT} "
23
23
print " INFO: env.JIRA_KEY = ${ env.JIRA_KEY} "
24
- print " INFO: RELEASE_ON_PUSH = ${ RELEASE_ON_PUSH} "
25
24
26
25
// --------------------------------------------
27
26
// Build conditions
@@ -34,10 +33,17 @@ if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
34
33
}
35
34
36
35
def manualRelease = currentBuild. getBuildCauses(). toString(). contains( ' UserIdCause' )
36
+ def cronRelease = currentBuild. getBuildCauses(). toString(). contains( ' TimerTriggerCause' )
37
37
38
38
// Only do automatic release on branches where we opted in
39
- if ( ! manualRelease && ! RELEASE_ON_PUSH ) {
40
- print " INFO: Build skipped because automated releases are disabled on this branch. See constant RELEASE_ON_PUSH in ci/release/Jenkinsfile"
39
+ if ( ! manualRelease && ! cronRelease ) {
40
+ print " INFO: Build skipped because automated releases on push are disabled on this branch."
41
+ currentBuild. result = ' NOT_BUILT'
42
+ return
43
+ }
44
+
45
+ if ( ! manualRelease && cronRelease && ! RELEASE_ON_SCHEDULE ) {
46
+ print " INFO: Build skipped because automated releases are disabled on this branch. See constant RELEASE_ON_SCHEDULE in ci/release/Jenkinsfile"
41
47
currentBuild. result = ' NOT_BUILT'
42
48
return
43
49
}
@@ -60,12 +66,15 @@ pipeline {
60
66
agent {
61
67
label ' Worker&&Containers'
62
68
}
69
+ triggers {
70
+ // Run every week Sunday midnight
71
+ cron(' 0 0 * * 0' )
72
+ }
63
73
tools {
64
74
jdk ' OpenJDK 11 Latest'
65
75
}
66
76
options {
67
77
buildDiscarder logRotator(daysToKeepStr : ' 30' , numToKeepStr : ' 10' )
68
- rateLimitBuilds(throttle : [count : 1 , durationName : ' day' , userBoost : true ])
69
78
disableConcurrentBuilds(abortPrevious : false )
70
79
preserveStashes()
71
80
}
0 commit comments