Scripted pipeline - how to run groovy post build script

725 views
Skip to first unread message

Shiran

unread,
Aug 28, 2017, 10:17:44 AM8/28/17
to Jenkins Users
Hi,

I created a pipeline job and I want to run a groovy script as a post build action.
It was easily done in a multijob project using the Groovy Postbuild Plugin, but in a pipeline job this option doesn't exist.

Please assist.
Thanks! :)

Shiran

unread,
Aug 29, 2017, 4:20:43 AM8/29/17
to Jenkins Users
And another question- I use "manager" object in groovy post build plugin, how can I use it in pipeline when this plugin is not supported?

Daniel Beck

unread,
Aug 29, 2017, 5:48:22 AM8/29/17
to Jenkins Users

> On 29. Aug 2017, at 01:20, Shiran <shira...@gmail.com> wrote:
>
> when this plugin is not supported?

Why would it not be?

Shiran

unread,
Aug 29, 2017, 6:31:02 AM8/29/17
to Jenkins Users, m...@beckweb.net
As far as I understand, 'manager' is available only in groovy postbuild plugin.
If not, than should I import any package for this? something?

Daniel Beck

unread,
Aug 29, 2017, 7:00:26 AM8/29/17
to jenkins...@googlegroups.com

> On 29. Aug 2017, at 03:31, Shiran <shira...@gmail.com> wrote:
>
> If not, than should I import any package for this? something?

The plugin has supported Pipeline since 2.3 in 2015 (when it was still called "workflow"). The 'manager' variable exists there as well.

Mark Waite

unread,
Aug 29, 2017, 10:06:36 AM8/29/17
to jenkins...@googlegroups.com
I use the groovy post-build plugin very often in my pipeline-based regression testing.  It works great in pipeline.

You can read the details in my lts-with-plugins repository, including a "logContains" function which uses manager.

Mark Waite

--
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/950EDB1F-A5BA-4469-9D38-19A841280E27%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.

Shiran

unread,
Aug 29, 2017, 10:11:22 AM8/29/17
to Jenkins Users
Thank you both!
Reply all
Reply to author
Forward
0 new messages