Trigger arbitrary build/post-build steps from pipeline

403 views
Skip to first unread message

Andrew Melo

unread,
Apr 17, 2016, 2:40:28 PM4/17/16
to Jenkins Users
Hello all,

I would like to trigger build/post-build steps that don't appear in the snippet viewer (e.g. publish TAP results) from a pipeline. Is there a way to trigger arbitrary build/post-build steps that don't appear in the snippet browser, or will the plugin need to be updated to explicitly support being triggered from pipelines?

Thanks!
Andrew

Andrew Melo

unread,
Apr 17, 2016, 9:24:43 PM4/17/16
to Jenkins Users
Hi again,

I poked at it some more and it appears I'll have to explicitly change the plugins I want to use in a pipeline. The following:

step([$class: 'TapPublisher', testResults: 'tap.log']) 

yields the following error:

no known implementation of interface jenkins.tasks.SimpleBuildStep is named TapPublisher

Or, perhaps a new groovy step that consumes classes of type 'Recorder' is the better idea?

Thanks again!
Andrew

Andrew Melo

unread,
Apr 21, 2016, 3:34:00 PM4/21/16
to Jenkins Users
Hi,

I've dug a bit more, perhaps that will help find a solution. It appears the "step" groovy function wants a class that implements SimpleBuildStep, but the plugins I'm looking at implements/extends hudson.tasks.Recorder. I'm confused about the issue. If I look at the javadoc:


I see that Recorder implements BuildStep, but not SimpleBuildStep. But (and my java is rusty, so forgive the terminology), since BuildStep is a superinterface of SimpleBuild step, shouldn't it "count" for when step() searches for a class implementing the interface?

Thanks
Andrew

Andrew Melo

unread,
Apr 25, 2016, 1:46:58 PM4/25/16
to Jenkins Users
ping? Is the shiny new pipeline functionality simply incompatible with all of the existing plugins?

Craig Rodrigues

unread,
Apr 25, 2016, 2:12:05 PM4/25/16
to Jenkins Users
From a pipeline, You cannot invoke methods in other Jenkins plugins unless
those plugins have been modified to support pipelines.  See:

https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md
https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md

--
Craig


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/5f309810-2ee4-4a4d-8b8f-4d93c846720c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages