Jelly server side methods

25 views
Skip to first unread message

Steven F

unread,
Aug 18, 2017, 6:49:17 PM8/18/17
to Jenkins Developers
Hi,

I know Jenkins provides some pre-defined buttons to call server side methods. I was wondering if there's a way to do this with other elements. My plan is to have clickable build badges that do server side things including kicking off a build. I know I can post to a URL to trigger a build but that doesn't cover it (unless I can define an endpoint that's connected to the badge class?)

Another related question: can a finished build register a new build as it's downstream build? Since these badges would appear after build completion.

Oleg Nenashev

unread,
Aug 19, 2017, 4:20:31 PM8/19/17
to Jenkins Developers
Hi,


I was wondering if there's a way to do this with other elements. My plan is to have clickable build badges that do server side things including kicking off a build. I know I can post to a URL to trigger a build but that doesn't cover it (unless I can define an endpoint that's connected to the badge class?)

Jelly itself offers few features for realtime actions, but buttons are one of them (e.g. Apply buttons in Jenkins WebUI). You only need to implement POST request handlers on the master side (search for REST API in Jenkins), and then you will be able to invoke actions on master using standard buttons.

Another related question: can a finished build register a new build as it's downstream build? Since these badges would appear after build completion.

Yes, you can modify actions and contents of finished builds. OTOH I would not advertise this way, because it may cause issues with plugins which do not expect it. At the contributor summit ate Jenkins World 2016 the current behavior was also mentioned as an obstacle for Pluggable Storage stories, so the behavior may change in one of the next Jenkins major releases (no confirmed plans / roadmap for them though).

BR, Oleg

суббота, 19 августа 2017 г., 0:49:17 UTC+2 пользователь Steven F написал:

Jesse Glick

unread,
Aug 21, 2017, 10:17:51 AM8/21/17
to Jenkins Dev
On Sat, Aug 19, 2017 at 4:20 PM, Oleg Nenashev <o.v.ne...@gmail.com> wrote:
> You only need to implement
> POST request handlers on the master side (search for REST API in Jenkins),
> and then you will be able to invoke actions on master using standard
> buttons.

You can also use `@JavaScriptMethod` and `st:bind` for complex cases.
Reply all
Reply to author
Forward
0 new messages