Triggering a multibranch pipeline build from a URL Change

83 views
Skip to first unread message

Greg Smith

unread,
May 24, 2017, 10:22:56 AM5/24/17
to Jenkins Users

We would like to trigger a multibranch pipeline build whenever a file at a URL changes.  We had a mechanism that worked, but a recent update broke that mechanism.

Here's what we had setup:

URLTrigger used to trigger a Freestyle build, named "Stage1"
Pipeline build that runs whenever "Stage1" build completes, called "Stage2"
Pipeline build starts multibranch pipeline build in its script.

This Rube Goldberg like series of steps were required because a Freestyle build can not start a Pipeline build, but a Pipeline build can be triggered by a Freestyle build.  A multibranch pipeline build can not be triggered by a pipeline build, but a pipeline build can directly start a multibranch pipeline build.

At least, these used to be the rules.  We upgraded to the latest LTS release (2.46.1 -> 2.46.2) and the ability for a pipleline build to be triggered by the completion of a Freestyle build now seems to be gone.

I can configure the Pipeline build to run when the Freestyle build complete, but it never actually triggers. 

Ugh -- was hoping someone might know what the current rules are, or point me to a jira / bug.  I'm not even sure where to file such a problem report, as I'm not sure if this is core Jenkins function, or something to do with the pipeline plugins.

Has anyone got a multibranch pipeline build triggered by a URL change?  Maybe I need to completely redesign this workflow.

Thanks much,
Greg

Greg Smith

unread,
May 26, 2017, 1:24:39 PM5/26/17
to Jenkins Users
Well, I haven't found a solution, but I have found why the scheme we had stopped working.  Seems this error is being thrown whenever the first triggering build runs:

RunListener failed
java.lang.NullPointerException
    at hudson.model.Result.isBetterOrEqualTo(Result.java:130)
    at jenkins.triggers.ReverseBuildTrigger.shouldTrigger(ReverseBuildTrigger.java:139)
    at jenkins.triggers.ReverseBuildTrigger.access$000(ReverseBuildTrigger.java:89)
    at jenkins.triggers.ReverseBuildTrigger$RunListenerImpl.onCompleted(ReverseBuildTrigger.java:258)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:211)
    at hudson.model.Run.execute(Run.java:1773)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:405)

Daniel Beck

unread,
May 28, 2017, 2:19:20 AM5/28/17
to jenkins...@googlegroups.com

> On 26. May 2017, at 19:24, Greg Smith <smithg...@gmail.com> wrote:
>
> jenkins.triggers.ReverseBuildTrigger.shouldTrigger(ReverseBuildTrigger.java:139)

In 'Build after other projects are built', did you specify a result option?

Danny Rehelis

unread,
May 28, 2017, 2:35:24 AM5/28/17
to jenkins...@googlegroups.com
Have a look here,


Seems like triggering a Pipeline job from Freestyle job should be soon possible.

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4DD8110F-392F-4429-A761-0F60C6D6CBF9%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages