Markus "Shorty" Uckelmann
unread,Aug 14, 2018, 5:07:43 AM8/14/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jenkins Users
Hi all,
I use the following code to trigger a job on a daily basis:
properties([[$class: 'BuildDiscarderProperty',
strategy: [$class: 'LogRotator', numToKeepStr: '10']],
pipelineTriggers([cron( env.BRANCH_NAME == 'master' ?
'@hourly' : '' )]),
])
Now I'd like to know, if the job was triggered by the cron trigger. Does
anybody know how this can be done?
I already tried this peace:
if (manager.logContains("Started by timer")){
echo "This build was triggered by a timer."
}
But it gave me the error: groovy.lang.MissingPropertyException: No such
property: manager for class: groovy.lang.Binding
Cheers, Shorty