Hi Christian, Here's my attempt at this (accidentally starting from master):
https://github.com/daniel-beck/saltstack-plugin/commits/refactor This is the bare minimum to get it to print a non-default 'jobPollTime' (parameter to 'local' client interface) when run in a pipeline job (or freestyle job). - Make the client interface into a Fruit-like (see ui-samples) class hierarchy - Change the constructor parameter and getter types - Implement SimpleBuildStep - Get rid of all actual 'perform' so I could try to run it :-) Note that this needs 1.609 or newer for f:class-entry, but I went up to 1.642.x to be able to install recent Pipeline releases in hpi:run Of course it looks like there's some more refactoring needed to make it really nice: - Break up constructors into ones with fewer arguments, and do the rest with @DataboundSetters, so fields with sensible defaults can be omitted from pipeline script - Really move parameters for specific client interfaces into their classes (making existing fields transient) - add readResolve compatibility code so existing job configs can be read successfully - @Symbol support for easier to read pipeline scripts - I'm not really happy with the $class/f:class-entry but otherwise I got Stapler errors, will need to look into alternatives > On 23.10.2016, at 19:26, Christian McHugh <[email protected]> wrote: > > Greetings all, > > I am attempting to add pipeline support to the saltstack build plugin. But > I'm having some difficulty wrapping my mind around the Jenkins framework part > of things. > > Previously the plugin was a bit of a hack. There was a dropdown in the gui > that based on the selection, included jelly files. The variables from these > files were then passed to the single class constructor and thus it had to > parse the json that was given. In deploying pipeline support, the groovy > generator is not able to figure out this json nonsense, so it it time to > break that up that process. > > Now I am attempting to create a few classes and pass their names to the > various includes. At this stage, I think things are mostly working (although > for anyone that knows what they are doing it is likely very ugly). However, > when running the pipeline groovy generator, I get errors related to the lack > of descriptors on the new classes. I have looked over the DropdownList > ui-sample as that does precisely what I'd like, but I don't quite understand > everything and could really use some additional guidance. I've just uploaded > my currently broken draft code to > https://github.com/jenkinsci/saltstack-plugin/tree/classing should anyone be > able to assist. > > > Thanks much! > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/c351fe08-af5f-4387-b341-54fd04ccb46f%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/500416A6-A580-4E18-9A03-3152D0889BA7%40beckweb.net. For more options, visit https://groups.google.com/d/optout.
