jenkinsfile-runner icon indicating copy to clipboard operation
jenkinsfile-runner copied to clipboard

Pipeline input() statement support

Open chhex opened this issue 4 years ago • 3 comments

This is nothing more than a question. If i have for example the following pipeline code:

input (id:"Ok" , message:"Ok?" , submitter: 'someUser')

On which Url is the jenkinsfile-runner waiting for Input?

Best thanks for the great work.

chhex avatar Apr 22 '20 13:04 chhex

Right now there is no URL exposed by Jenkinsfile Runner. It still starts the Web server internally due to some Jenkins architecture things, but we do not expose URL for REST API by default.

It would be great to have a way to use the input statement. Passing input through STDIN would be the most straightforward way, but I am not sure this is what would be used by users. Feedback and suggestions are welcome

oleg-nenashev avatar Apr 22 '20 14:04 oleg-nenashev

For a first go STDIN, would be great. For our usage scenario a File based Input, where naturally the File would need to be unique to the requesting Input statement, similar to a Rest Url, would be more suitable

chhex avatar Apr 30 '20 05:04 chhex

For our usage scenario a File based Input, where naturally the File would need to be unique to the requesting Input statement, similar to a Rest Url, would be more suitable

Yes, it could be a good solution. It is possible to do such engine on the Jenkinsfile Runner side, but it might be better to have a separate plugin for that so that classic Jenkins instances could support a similar feature.

Apparently, CLI is even harder to implement with the current Pipeline Flow Graph listener. Pipeline execution and CLI IO happen in separate threads, so the synchronization would require a few extra steps if we don't want to break the log layout. I do not even speak about input() inside parallel() which will be a mess in CLI without huge rework.

oleg-nenashev avatar Jul 28 '20 11:07 oleg-nenashev