openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

Declarative pipeline support? #155

Closed keirlawson closed 7 years ago

keirlawson commented 7 years ago

Is it possible to use this plugin with the new "declarative" Jenkins pipeline syntax (see https://jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline)? If so is there an example of this somewhere? If not is this feature planned/is there an alternative approach?

gabemontero commented 7 years ago

Hi @keirlawson - we are targeting the plugin at https://github.com/openshift/jenkins-client-plugin as our player in the declarative pipeline space.

That plugin has been in our openshift jenkins centos image for a few cycles now, and will be officially supported in our upcoming openshift 3.7 release.

Some examples are being compiled as I type for jenkins-client-plugin. Ideally, one of them would include a declarative pipeline example.

That said, per the announcement on declarative pipeline at https://jenkins.io/blog/2016/12/19/declarative-pipeline-beta/ you should still be able to use the pipeline dsl steps provided by this plugin. But the look and feel of the syntax with jenkins-client-plugin better lines up with declarative pipeline.

@bparees @coreydaley @csrwng @jupierce fyi - and of course elaborate in any ways y'all see fit :-)

keirlawson commented 7 years ago

Thanks for your informative response!

csrwng commented 7 years ago

One thing to keep in mind is that to use the jenkins-client-plugin inside the new declarative pipeline steps section, you need to wrap the code with a script step. If you do not want to use the script step every time, one alternative is to create a library that wraps your jenkins-client-plugin actions into steps that you can include directly in your declarative pipeline.

gabemontero commented 7 years ago

Ah - good to know - thanks @csrwng ! I knew your ci explorations would prove valuable here :-)

@coreydaley - if you haven't already, in updating the doc's for client plugin, you should link up with @csrwng and pick his brain for juicy user experiences like this.