Trigger a build and pass parameters

30 views
Skip to first unread message

Ronni Elken Lindsgaard

unread,
May 8, 2013, 3:44:33 AM5/8/13
to jenkin...@googlegroups.com
I would like to be able to trigger a build from an action, and at the same time give it a specific parameter.

It is the same functionality as with a parametrized build. However, I would like my plugin to do this automatically, such that the user does not need to set up the parameters for the build manually.

I could probably use a semaphore file, but it would be great if it was possible to pass it directly.

Ronni Elken Lindsgaard

unread,
May 8, 2013, 3:48:11 AM5/8/13
to jenkin...@googlegroups.com
Forgot my question: Is it possible to give the build these parameters? And how? 

Kenny Ayers

unread,
May 8, 2013, 7:19:34 PM5/8/13
to jenkin...@googlegroups.com
Hey Ronni,


  That will allow you to trigger a downstream job using parameters from a given build.  I'm not entirely sure that's what you've asked for in your inquiry, but it may be helpful.

-Kenny

Ronni Elken Lindsgaard

unread,
May 9, 2013, 2:19:42 AM5/9/13
to jenkin...@googlegroups.com
Hi Kenny

Thanks for your reply.

Unfortunately, the Parameterized Trigger Plugin still forces my original job to be configured with parameters - My plugin "knows" the names and types of the parameters, so it would be tedious for a user to have to set up the same parameters each time a job is configured.

The thing is, I have a remote repository where I would like to grab a specific revision to build, so I would like a parameter named revision (as well as some other standard parameters such as who triggered it and similar). 
I am hoping it is possible to give the a build some information when i trigger it. I know how to trigger it, but it cannot get my head around giving it extra environment variables, a log message or any other possible option. (maybe i can pass some information in an action with the scheduleBuild2 method?) 


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/_w6ysAEk5hk/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Mvh
Ronni Elken Lindsgaard

cjo

unread,
May 9, 2013, 11:48:31 AM5/9/13
to jenkin...@googlegroups.com


If you are triggering a build from within your Action using the AbstractProject.scheduleBuild()[1] then pass your own generated ParametersAction, as the third item, containing the required parameters.
Note: Default parameters from the triggered job are not added if they are not passed in. issue JENKINS-13768 [2] which has a pull request pending [3].

Reply all
Reply to author
Forward
0 new messages