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
--
You received this message because you are subscribed to the Google Groups "Jenkins
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/f821fe5f-a601-2d8f-453e-4ab22e29bded%40koeln.de.
For more options, visit https://groups.google.com/d/optout.