Extension availability from Workflow Groovy CPS DSL

75 views
Skip to first unread message

Mikhail Vassiliev

unread,
Jan 14, 2015, 4:21:18 PM1/14/15
to jenkins...@googlegroups.com

Hello,

 

I have searched through the entire email group and did not find an answer on my question.

I would like to use “External Resource Dispatcher plugin” in my workflow test job. The idea is to connect several devices to Jenkins slaves, configure the corresponding resources in the nodes that match to the slaves, and use the resources in the workflow test job.

According to the “External Resource Dispatcher plugin” description, I can obtain the plugin’s extension and lock a resource using the following code:

 

def manager = extension.'externalresource-dispatcher'

manager.lock(...)

 

But Workflow component does not understand the code. How can I obtain a plugin’s extension from Workflow Groovy CPS DSL script?

 

Thank you,

Mikhail

 

James Nord

unread,
Jan 15, 2015, 3:58:07 AM1/15/15
to jenkins...@googlegroups.com
Currently you can't.  Plugins must be aware of the workflow plugin and implement some code for it.  The above snippet is for the build-flow plugin which is a different plugin.

/James

Jesse Glick

unread,
Jan 15, 2015, 3:18:12 PM1/15/15
to jenkins...@googlegroups.com
On Thursday, January 15, 2015 at 3:58:07 AM UTC-5, James Nord wrote:
Plugins must be aware of the workflow plugin and implement some code for it.


There are of course some cases where the functionality of the plugin is unnecessary in a workflow because you can just express the desired logic directly in your script. Integrations are needed for plugins which expose true features (rather than workarounds for limitations of freestyle projects). It seems like in this case the functionality is real and needs an integration, since you would want to do configuration on the node, and may have external tools using CLI or REST to update the status of specific nodes. So it would make sense to file an RFE for the plugin to add a Workflow step (probably block-scoped, so the lock release is implicit); add the ‘workflow’ label and mention in COMPATIBILITY.md.
Reply all
Reply to author
Forward
0 new messages