Quantcast

Scheduled job vs manually started job

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Scheduled job vs manually started job

Benjamin Lau
Hello,

Is there some way to determine from a shell build step whether the current job was scheduled or started manually (via web interface)? I'm trying to implement a single job but i need slightly different behavior when scheduling the job vs running it directly.  If there isn't that's okay i can just create wrapping jobs with the different defaults I need... but i find this solution a bit clunky.

Thanks in advance,
Ben
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Scheduled job vs manually started job

Gregory Boissinot
Check the BUILD_CAUSE environment variable value from your program.
By default, the values can be:
- MANUALTRIGGER
- SCMTRIGGER
- MANUALTRIGGER
UPSTREAMTRIGGER

Then, plugins (such as XTrigger plugins) can provide additional cause values.

On Fri, Jun 29, 2012 at 10:19 AM, benjamin.a.lau <[hidden email]> wrote:
Hello,

Is there some way to determine from a shell build step whether the current job was scheduled or started manually (via web interface)? I'm trying to implement a single job but i need slightly different behavior when scheduling the job vs running it directly.  If there isn't that's okay i can just create wrapping jobs with the different defaults I need... but i find this solution a bit clunky.

Thanks in advance,
Ben

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Scheduled job vs manually started job

cjo9900

There is also the conditional build step plugin which you can use which will allow check the build cause and then run a single or multiple buildstep(s).

You will need to have separate buildsteps in this case, for each of the different causes and the common parts. 


Chris

On Friday, June 29, 2012 5:56:24 PM UTC+1, gboissinot wrote:
Check the BUILD_CAUSE environment variable value from your program.
By default, the values can be:
- MANUALTRIGGER
- SCMTRIGGER
- MANUALTRIGGER
UPSTREAMTRIGGER

Then, plugins (such as XTrigger plugins) can provide additional cause values.

On Fri, Jun 29, 2012 at 10:19 AM, benjamin.a.lau <[hidden email]> wrote:
Hello,

Is there some way to determine from a shell build step whether the current job was scheduled or started manually (via web interface)? I'm trying to implement a single job but i need slightly different behavior when scheduling the job vs running it directly.  If there isn't that's okay i can just create wrapping jobs with the different defaults I need... but i find this solution a bit clunky.

Thanks in advance,
Ben

Loading...