[JIRA] (JENKINS-59823) Extend cps interface so plugins can que additional Steps.

1 view
Skip to first unread message

mail@leonmoll.de (JIRA)

unread,
Oct 17, 2019, 8:28:02 AM10/17/19
to jenkinsc...@googlegroups.com
Leon Moll created an issue
 
Jenkins / Improvement JENKINS-59823
Extend cps interface so plugins can que additional Steps.
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: workflow-cps-plugin
Created: 2019-10-17 12:27
Priority: Minor Minor
Reporter: Leon Moll

I'm building a Plugin in Jenkins that provides an API for scripts that are started from a pipeline-script to independently communicate with jenkins. For example a shell-script can then tell jenkins to start a new stage from the running script.

After getting the communication between the plugin and the script working with Unix Domain Sockets, I wanted to start a stage from an exported callback proxy. Here is where I've hit a brick wall. I was unable to hook into life cycle and inject a new StageStep in any way I could think of. This SO issue demonstrates my stuggles: https://stackoverflow.com/q/58409878/3968618
So finally I've got it to work with reflection (see the answer), but as you can tell, it's hacky as hell.

This issue is a request to provide an interface to safely inject a new step by name. Basically a way to simply call DSL.invokeStep(sd, args) from inside a step/callback.
I understand this is not the intentional usage, and you might feel the request is hacky in and of itself. But I have been thinking about building a way for scripts to asynchronously communicate with jenkins for some time now, and feel it would be a very good way to make calling things like shell scripts from a pipeline much more powerful, useful and extendable. If my company will allows this, I am planning to make the plugin publicly available for anyone to use.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages