Converting Plugin to Pipelines - getting JobProperty

12 views
Skip to first unread message

Randall Becker

unread,
Nov 7, 2018, 9:34:31 AM11/7/18
to Jenkins Developers
Hi All,

Biting the bullet converting to Pipelines. The current version uses the perform(AbstractBuild<?,?>,Launcher,BuildListener listener) interface - obvious fine for the old way, but deriving from SimpleBuildStep, the new interface is perform(Run<?, ?>,FilePath,Launcher,TaskListener), again obviously. The difficulty I'm having is that the plugin has extensive JobProperty attributes (about 10) that I can't figure out how to retrieve in the new interface. This may be that the way to do things in pipelines is not to use JobProperty but to specify everything in a pipeline step definition and coding for that; or that there is a way of finding the associated JobProperty object that I haven't found yet. I would rather use JobProperty, so would someone mind pointing out the technique of getting it in "the new way". The great converting guide is unclear (at least to me) on this point.

TIA,
Randall


Jesse Glick

unread,
Nov 7, 2018, 10:20:52 AM11/7/18
to jenkin...@googlegroups.com
On Wed, Nov 7, 2018 at 9:34 AM Randall Becker <the.n...@gmail.com> wrote:
> the plugin has extensive JobProperty attributes (about 10) that I can't figure out how to retrieve in the new interface

Nothing different here. `JobProperty` can apply to any `Job`, not just
`AbstractProject`, and a `SimpleBuildStep` could retrieve properties
in the same way.

> This may be that the way to do things in pipelines is not to use JobProperty but to specify everything in a pipeline step definition and coding for that

Yes, that would be the preferable design in general.
Reply all
Reply to author
Forward
0 new messages