Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Hudson » Build initiator(How do I find out who started a build?)
Build initiator [message #1095226] Mon, 26 August 2013 20:10 Go to next message
Stuart Lorber is currently offline Stuart Lorber
Messages: 44
Registered: June 2013
Member
I need to know if a build was kicked off by a user or by an upstream job or via SCM.

Based on how the build was initiated I need to perform slightly different actions in the build.

Is there a way to determine this from within a job?
Re: Build initiator [message #1095807 is a reply to message #1095226] Tue, 27 August 2013 14:56 Go to previous messageGo to next message
Stuart Lorber is currently offline Stuart Lorber
Messages: 44
Registered: June 2013
Member
We need to find what is the replacement for the API getJob on the class Hudson.

We're trying to find out how a job was launched.

There used to be methods getCause() / GetCauses().

The method getCauses in defined in the class Run?
Re: Build initiator [message #1097510 is a reply to message #1095807] Thu, 29 August 2013 20:42 Go to previous messageGo to next message
Winston Prakash is currently offline Winston Prakash
Messages: 417
Registered: August 2011
Location: Fremont, CA USA
Senior Member
I'm guessing you are doing this in a plugin. In your builder or publisher Extension, you can use the method getProjectActions(AbstractProject<?,?> project). In the returned Collection of Actions look for CauseAction and retrieve the List of Causes using CauseAction.getCauses()

Winston Prakash
Eclipse Hudson team
Re: Build initiator [message #1100780 is a reply to message #1097510] Tue, 03 September 2013 15:24 Go to previous message
Stuart Lorber is currently offline Stuart Lorber
Messages: 44
Registered: June 2013
Member
We were actually trying to run this in a groovy script.
Previous Topic:Hudson exception for git clone
Next Topic:Hudson : Slow login issue
Goto Forum:
  


Current Time: Tue Sep 16 21:38:42 GMT 2014

Powered by FUDForum. Page generated in 0.01777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software