Any way to determine trigger source, whether manual build or scm change?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Any way to determine trigger source, whether manual build or scm change?

Lars Nordin

Is there any way to determine trigger source, whether manual build or scm change?

 

I have a job that takes a parameter when manually triggered but when triggered from a git commit I plan to set that parameter from info gathered from GIT. I guess one way would be to change the default parameter to a “null” value then I would know that the build was triggered by SCM change – are there any other ways?

Reply | Threaded
Open this post in threaded view
|

Re: Any way to determine trigger source, whether manual build or scm change?

domi@fortysix.ch
<base href="x-msg://2745/">
The 'envinject plugin' publishes the causes of the build as environment variables:
BUILD_CAUSE: contains all causes coma separated
BUILD_CAUSE=USERIDCAUSE, SCMTRIGGER, UPSTREAMTRIGGER 

In addition, each cause is exposed as a single envvariable too:
BUILD_CAUSE_USERIDCAUSE=true
BUILD_CAUSE_SCMTRIGGER=true
BUILD_CAUSE_UPSTREAMTRIGGER=true

/Domi


On 20.12.2012, at 17:51, Lars Nordin <[hidden email]> wrote:

Is there any way to determine trigger source, whether manual build or scm change?
 
I have a job that takes a parameter when manually triggered but when triggered from a git commit I plan to set that parameter from info gathered from GIT. I guess one way would be to change the default parameter to a “null” value then I would know that the build was triggered by SCM change – are there any other ways?