File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ /* groovylint-disable VariableName */
1
2
// vars/startedByTimer.groovy
2
3
3
4
/**
6
7
* This needs to be here rather than in pipeline-lib or Jenkinsfile due to
7
8
* Scripts not permitted to use method net.sf.json.JSON isEmpty.
8
9
*/
9
- Boolean call (Map config = [:] ) {
10
+ Boolean call () {
10
11
11
- return ! currentBuild. getBuildCauses(' hudson.triggers.TimerTrigger$TimerTriggerCause' ). isEmpty()
12
+ Boolean simulate_timed_job = cachedCommitPragma(' Simulate-timed-job' ) == ' true'
13
+
14
+ if (simulate_timed_job) {
15
+ println (' Simulating timed job behaviour' )
16
+ }
17
+
18
+ return simulate_timed_job ||
19
+ /* groovylint-disable-next-line UnnecessaryGetter */
20
+ ! currentBuild. getBuildCauses(' hudson.triggers.TimerTrigger$TimerTriggerCause' ). isEmpty()
12
21
13
22
}
You can’t perform that action at this time.
0 commit comments