Jenkins plugin for invoking external async jobs and polling their results

527 views
Skip to first unread message

matti...@softagram.com

unread,
Aug 27, 2018, 2:56:40 AM8/27/18
to Jenkins Users
I might not have done enough research but so far I wasn't able to find too many Jenkins plugins or instructions that would handle this kind of scenario:

- At the beginning of a Jenkins job, trigger a webhook on an external service, possibly getting back some kind of (non-Jenkins) job ID
- Wait until the external job is finished (polling the service or subscribing to events), fetch the results using the API of that external service
- Finish the job and set its status based on the external job results

The issue is that the job running on an external platform cannot be run as part of the build on Jenkins slaves but it still needs to be part of a long, complex chain of Jenkins jobs. Thus, Jenkins is just used as a way to trigger the external job and publish its results.

Some plugins that I stumbled upon:
https://github.com/jenkinsci/coverity-plugin/ - the Coverity Connect related parts could be vaguely similar but it seems to be quite a complex plugin to even just copy the basic ideas from
https://plugins.jenkins.io/external-monitor-job - the name sounds promising but I think, in my case, it ends there

What I'm looking after is:
- suggestions of plugins that already do something like this (which I can either fork or just take ideas from)
- alternatively, is there already a better way of achieving the same thing with Jenkins and I just didn't realize it yet?

Thanks a lot!

Gardell, Steven

unread,
Sep 4, 2018, 8:33:19 AM9/4/18
to jenkins...@googlegroups.com

We accomplish this by polling within an imperative pipeline script. It isn’t all that complicated. The downside is that completion of the Jenkins script now becomes less deterministic so we have wound up with the Jenkins build hanging (and blocking downstream builds) as a result of problems in the external mechanism. But I guess you get what you ask for.

 

From: jenkins...@googlegroups.com <jenkins...@googlegroups.com> On Behalf Of matti...@softagram.com
Sent: Monday, August 27, 2018 1:58 AM
To: Jenkins Users <jenkins...@googlegroups.com>
Subject: Jenkins plugin for invoking external async jobs and polling their results

 


NOTICE: This email was received from an EXTERNAL sender


--
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/71b2211f-ff3d-4fa1-8a49-e555ee6397cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

 

Steven Gardell 
Director of Application Security and DevOps 
4  Technology Park Drive Westford, MA 01886 USA 
office: +1.978.614.8831 
GENBAND.com

 

Reply all
Reply to author
Forward
0 new messages