Project doBuild with Stapler

15 views
Skip to first unread message

Sverre Moe

unread,
Mar 17, 2015, 5:34:54 AM3/17/15
to jenkin...@googlegroups.com
Trying to call doBuild on a project in Groovy. I cannot find any examples on how to use this method when it comes down to StaplerRequest and StaplerResponse.

I am tempted to just call newBuild(), but I guess that would not get me a hook into that build process/result.

I am iterating through a list of downstream projects:
For each downstream project, call doBuild. 
    The upstream project should wait, probably with project.setBlockBuildWhenDownstreamBuilding(true)
    If downstream project fails, then fail upstream project

Using Groovy Postbuild 2.2 with latest Jenkins 1.604

Daniel Beck

unread,
Mar 17, 2015, 5:39:58 AM3/17/15
to jenkin...@googlegroups.com
These functions are not supposed to be called directly, they clearly handle HTTP requests.

Just call scheduleBuild2 and use the returned QueueTaskFuture.
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d882fbc5-35dc-4642-aaaf-6d0e2c5b013f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Sverre Moe

unread,
Mar 17, 2015, 5:50:26 AM3/17/15
to jenkin...@googlegroups.com, m...@beckweb.net
Thank you for that. Difficult to find out these things by just reading the API.
Reply all
Reply to author
Forward
0 new messages