script-server icon indicating copy to clipboard operation
script-server copied to clipboard

Possibility to use webhook from within scripts

Open zrks opened this issue 4 years ago • 4 comments

Hi, as we're currently switching some jobs from Jenkins to script-server, I was wondering if (and how) it would be possible to implement something like this on script-server - https://plugins.jenkins.io/webhook-step/

Idea is that there generated url that script server would issue and accept post request to get some data to script is executed by script-server.

Have no experience in this regard, any idea would be appreciated.

zrks avatar Aug 31 '21 10:08 zrks

Hi @zrks to be honest, I'm not sure, that it would be achievable easily with a script server (in the end, it's not a build tool, but just a UI for scripts).

Could you use existing user-input functionality? (i.e. user can input any data during script runtime). And then the script would just wait for user input At the moment, there is no REST webhook for sending user input, since it's sent via Websocket. But it should be possible to add a POST endpoint on top of websocket for script server.

bugy avatar Aug 31 '21 11:08 bugy

Thank you very much for response!

Thing is that I need that input data from external service that script-server user interacts via script-server in order to present it for him. Idea: script-server user launches script -> external system is triggered -> external system generates some data -> external system sends data back to script server

I understand your idea about script-server being just UI. Will check one workaround I have in mind.

zrks avatar Aug 31 '21 11:08 zrks

@zrks I understand your flow better now In this case, I would really suggest to use user input for it (it's (or may be) available via API as well)

bugy avatar Aug 31 '21 11:08 bugy

I'm using https://github.com/adnanh/webhook for stuff related to webhooks with script-server. Works well for me.

On Tue, Aug 31, 2021 at 2:46 PM Iaroslav Shepilov @.***> wrote:

@zrks https://github.com/zrks I understand your flow better now In this case, I would really suggest to use user input for it (it's (or may be) available via API as well)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/486#issuecomment-909160850, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC26OU5OKM555B5U2PR23YDT7S6JRANCNFSM5DD2KTWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Danny Rehelis - autogun [AT] gmail.com

drehelis avatar Aug 31 '21 13:08 drehelis