On Thu, Sep 19, 2013 at 3:21 PM, Daniel Beck <m...@beckweb.net> wrote:
>
>> it's just about using the adequate jenkins API
>> Jenkins.instance.getItemByFullName("job").scheduleBuild(...)
>
> Let's make this into a real example. Execution of two other jobs (in parallel 
> even) below, plus copying their artifacts, all within a Groovy system build 
> step.
>
> ----
>
> hudson.model.queue.QueueTaskFuture build(String fullName) {
>   def p = jenkins.model.Jenkins.instance.getItemByFullName(fullName)
>   def thisR = Thread.currentThread().executable
>   def f = p.scheduleBuild2(p.quietPeriod, new 
> hudson.model.Cause.UpstreamCause(thisR))
>   return f
> }
>
> def f1 = build('test-artifact-source-1')
> def f2 = build('test-artifact-source-2')
>
> // wait for both builds to finish
> def b1 = f1.get()
> def b2 = f2.get()

Thanks - I think this is going to be the best approach, but not being
a java developer, the full API is pretty intimidating and it would be
nice to keep the boilerplace code out of sight.   Is there any way to
incorporate something that looks like the build flow DSL - or at least
the functions it offers into a library that would be available in any
groovy build step?  That could match the convenience without imposing
the restrictions of a separate plugin.

-- 
   Les Mikesell
     lesmikes...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to