Pipeline Recipe for Timer Cause vs User Build Button Cause?

12 views
Skip to first unread message

jieryn

unread,
Jan 16, 2018, 8:41:26 AM1/16/18
to Jenkins Users
I use the latest Jenkins release with all the common plugins fully up
to date on RHEL 7 via Java 8.

Does anyone happen to have a recipe I can follow to set different
`defaultValue` for ```parameters { booleanParam (defaultValue: xxx,
...) }``` depending on whether the this run was triggered by a timer
action or by a user action?

I use build parameters to enable/disable various stages in the
pipeline, many of which are long running, depending on whether or not
I want to pay the cost/time for those stages at that moment. Sometimes
I just want to quickly get through to a particular phase of testing,
or perhaps to production deployment. And I know I can skip the costly
phases and just get right to where I want the build to go, but still
using the automated pipeline which has become the standard vehicle for
delivering to production.

I'm finding that when the build is triggered via timer, Jenkins should
not skip any stages; but it is common when developers trigger builds
manually that build execution is always customized in common ways. Any
help is appreciated to reduce the amount of time I'm spending clicking
checkboxes in manually triggered builds,

Thanks!

Victor Martinez

unread,
Jan 16, 2018, 8:50:14 AM1/16/18
to Jenkins Users
I guess the below can help you out with the build cause:
https://github.com/jenkinsci/pipeline-examples/tree/master/pipeline-examples/get-build-cause

cheers
Reply all
Reply to author
Forward
0 new messages