Attaching to QueueTaskDispatcher extension point without a plugin

16 views
Skip to first unread message

Alexander Yustus

unread,
Jan 31, 2017, 10:55:20 PM1/31/17
to Jenkins Users
Hi all,

I want to implement the feature to prevent a Pipeline job from even starting when there is no available executors with certain label.
I didn't found any plugins that do the exact thing, and I'm no java developer, so writing my own plugin is what I really want to avoid ;)

That said, is there a way to add an extension for QueueTaskDispatcher via Groovy script,
for example, using Groovy Events Listener Plugin?

thank you in advance,
Alexander.

Stephen Connolly

unread,
Feb 1, 2017, 3:14:48 AM2/1/17
to jenkins...@googlegroups.com
Writing a plugin would be easier than your suggested approach.

Writing a plugin is not that hard. You'll just start with an empty plugin and add your extension class.

--
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/50d9ea71-2acd-4bb6-96c5-a6d8554fe949%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

Alexander Yustus

unread,
Feb 16, 2017, 7:04:55 AM2/16/17
to Jenkins Users
Hi Stephen,

thank you for the answer!

Still, the question is: is there a way to do the thing (without plugin), and how, if the answer is 'yes'?

wbr, Alexander.

Stephen Connolly

unread,
Feb 16, 2017, 7:09:59 AM2/16/17
to jenkins...@googlegroups.com
it should technically be possible to do it through the groovy console... but I would not try unless the bet was large enough to justify the considerable effort... especially when writing a plugin to do it will give you IDE autocompletion and would take *me* maybe 5 minutes compared with at least several hours if not days to do it through the groovy console... so yes, expect several orders of magnitude harder through the groovy console than writing a plugin

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e9061a87-8fbe-4e0a-b96a-c0b33d4cd203%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages