Sunday, 15 June 2014

Creating dynamic content on Project page with Jenkins Plugin -



Creating dynamic content on Project page with Jenkins Plugin -

i'm getting started writing plugins jenkins, , i'm having problem making much headway in exceptionally terse documentation i've been able find it. main thing i'm trying generate dynamic content place on top-level page particular project. specifically, want show content derived recent build of project.

based on skeleton project , htmlpublisher plugin, i've been able create publisher plugin creates action getprojectactions, , action has floatingbox.jelly view, contents rendered @ top of project page. far, good.

now want create content dynamic. instance, publisher plugin might generate html content post-build step, , want display html (from latest build) @ top of project page. or (more likely), i'll want generate html based on builds, , display (e.g., plot showing some kind of "quality mesaurement" each of lastly n builds).

i'm brand new maven , jelly, , quite new jenkins matter, help useful.

update

i've found can utilize ${it} within jelly scripts access project object, can access publisher instance there, in order invoke methods on generate content?

the thing i've come far iterate on list of publishers provided getpublisherslist() on project object, , 1 class name matches class. can't find way instanceof in jelly script.

<j:foreach items="${it.publisherslist}" var="pub"> <j:if test='${pub.class.name == "com.example.mypluginname.mypublisherclassname"}'> <!-- ${pub} publisher instance, can invoke methods on it. --> </j:if> </j:foreach>

alternatively, if utilize jobmain.jelly instead of floatingbox.jelly, in case ${it} action itself.

jenkins-plugins

No comments:

Post a Comment