Is there any difference in plugin development of pipeline and freestyle project

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there any difference in plugin development of pipeline and freestyle project

varun vikas
Hi,

I am developing a plugin which reads xml file and do copy,zip,delete file and also execute commands on slave/master machine.
It is working fine on freeStyle project. what chnages I have to do to work this plugin on pipeline projects.

Thanks,
Varun

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d5749f61-46c9-49e4-a24a-7f804c1902a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any difference in plugin development of pipeline and freestyle project

Ulli Hafner
Which extension point does your plugin implement? Typically you can simply implement a SimpleBuildStep, then your recorder works out of the box for pipelines. See https://jenkins.io/doc/developer/plugin-development/pipeline-integration/ for details


Am 14.06.2019 um 07:57 schrieb varun vikas <[hidden email]>:

Hi,

I am developing a plugin which reads xml file and do copy,zip,delete file and also execute commands on slave/master machine.
It is working fine on freeStyle project. what chnages I have to do to work this plugin on pipeline projects.

Thanks,
Varun

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d5749f61-46c9-49e4-a24a-7f804c1902a7%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/B79D2DAE-7C11-4AEA-95F3-78A94BEFAFE0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any difference in plugin development of pipeline and freestyle project

varun vikas
Hi Ulli,

I have extended Builder .
e.g

public class FileOperationsBuilder extends Builder
and override
@Override
public boolean perform(final AbstractBuild<?, ?> build, final Launcher launcher, final BuildListener listener)
throws InterruptedException, IOException

Here I need AbstractBuild<?,?> because I have to call getBuiltOn function to execute batch and sh scripts on slave.

if I implement SimpleBuildStep, I have to override
   @Override
    public void perform(Run build,
                        FilePath workspace,
                        Launcher launcher,
                        TaskListener listener) throws InterruptedException, IOException {
        listener.getLogger().println("What was " + what + "?");
    }

and I will not get AbstractBuild<?,?> which I need for running commands on slave.

Should I use SimpleBuildStep or extending Builder will also handle pipeline plugin development.
please help.

Thanks,
Varun
On Friday, 14 June 2019 12:52:04 UTC+5:30, Ulli Hafner wrote:
Which extension point does your plugin implement? Typically you can simply implement a SimpleBuildStep, then your recorder works out of the box for pipelines. See <a href="https://jenkins.io/doc/developer/plugin-development/pipeline-integration/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fdeveloper%2Fplugin-development%2Fpipeline-integration%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHbG-vapbf3zI9CkUwbVzkOshJpRw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fdeveloper%2Fplugin-development%2Fpipeline-integration%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHbG-vapbf3zI9CkUwbVzkOshJpRw&#39;;return true;">https://jenkins.io/doc/developer/plugin-development/pipeline-integration/ for details


Am 14.06.2019 um 07:57 schrieb varun vikas <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="PYWMWRv1AwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">varun...@...>:

Hi,

I am developing a plugin which reads xml file and do copy,zip,delete file and also execute commands on slave/master machine.
It is working fine on freeStyle project. what chnages I have to do to work this plugin on pipeline projects.

Thanks,
Varun

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="PYWMWRv1AwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkin...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-dev/d5749f61-46c9-49e4-a24a-7f804c1902a7%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/d5749f61-46c9-49e4-a24a-7f804c1902a7%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-dev/d5749f61-46c9-49e4-a24a-7f804c1902a7%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-dev/d5749f61-46c9-49e4-a24a-7f804c1902a7%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/29a9a613-5766-4b14-840b-c40cac5bc0d0%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any difference in plugin development of pipeline and freestyle project

slide
Why can't you run things on an agent without AbstractBuild? You MUST either implement SimpleBuildStep as you have specified, or provide a separate implementation for Pipeline that implements a step. I highly recommend doing the former so you can share code between FreeStyle and Pipeline were appropriate. 

On Sat, Aug 24, 2019 at 2:56 PM varun vikas <[hidden email]> wrote:
Hi Ulli,

I have extended Builder .
e.g

public class FileOperationsBuilder extends Builder
and override
@Override
public boolean perform(final AbstractBuild<?, ?> build, final Launcher launcher, final BuildListener listener)
throws InterruptedException, IOException

Here I need AbstractBuild<?,?> because I have to call getBuiltOn function to execute batch and sh scripts on slave.

if I implement SimpleBuildStep, I have to override
   @Override
    public void perform(Run build,
                        FilePath workspace,
                        Launcher launcher,
                        TaskListener listener) throws InterruptedException, IOException {
        listener.getLogger().println("What was " + what + "?");
    }

and I will not get AbstractBuild<?,?> which I need for running commands on slave.

Should I use SimpleBuildStep or extending Builder will also handle pipeline plugin development.
please help.

Thanks,
Varun
On Friday, 14 June 2019 12:52:04 UTC+5:30, Ulli Hafner wrote:
Which extension point does your plugin implement? Typically you can simply implement a SimpleBuildStep, then your recorder works out of the box for pipelines. See https://jenkins.io/doc/developer/plugin-development/pipeline-integration/ for details


Am 14.06.2019 um 07:57 schrieb varun vikas <[hidden email]>:

Hi,

I am developing a plugin which reads xml file and do copy,zip,delete file and also execute commands on slave/master machine.
It is working fine on freeStyle project. what chnages I have to do to work this plugin on pipeline projects.

Thanks,
Varun

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d5749f61-46c9-49e4-a24a-7f804c1902a7%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/29a9a613-5766-4b14-840b-c40cac5bc0d0%40googlegroups.com.


--

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVfQ0O6J6wfeDfnyuofBBf0GRspLxEVMPx9srqO00hWBhA%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Is there any difference in plugin development of pipeline and freestyle project

varun vikas
Hi Slide,

    Thanks alot for your valuable suggestion. I have made changes in my code to implement SimpleBuildStep and its working fine.

-Varun 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5dea3f90-3b36-447d-9be9-7bf486809067%40googlegroups.com.