Return value from step (pipeline)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Return value from step (pipeline)

sreeram yerrapragada
Hello Jenkins Users,

Is it possible to capture the return value from pipeline step?

ex:
def result = findbugs(pattern: '**/target/**/findbugsXml.xml')
echo result


Thanks
Sreeram

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e9e3a605-66ae-4cb4-a2aa-6574d604dcd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Return value from step (pipeline)

Ramanathan Muthaiah
Is it possible to capture the return value from pipeline step?

ex:
def result = findbugs(pattern: '**/target/**/findbugsXml.xml')
echo result

To store cmd status or output, you should use sh(). You will find code snippets in this link, https://jenkins.io/doc/pipeline/examples/

BTW, Jenkins Pipeline doc has step called, "findFiles" but there is nothing like, findbugs. Is that your custom function?

/Ram
 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/fc1b0b4e-bb5b-4f23-b408-ab9965d8692b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Return value from step (pipeline)

Mark Waite-2
Pipeline step return values can be captured.

Refer to "https://github.com/MarkEWaite/jenkins-bugs/blob/e47d74ea8185c24d9c9531b7a126ae4a8fadef56/Jenkinsfile#L39" for an example of the return value of "checkout" being assigned and used.

Ramanathan, "findbugs" is a step added by the findbugs plugin.  It was added in findbugs plugin version 4.70.

I don't know if the findbugs step returns a value you could use.  I thought it had settings which would mark the build as stable or unstable depending on the detection of findbugs warnings.  The Jenkins plugin development infrastructure can run findbugs as part of plugin continuous integration, and marks the build unstable when a findbugs warning is detected.

Mark Waite

On Thu, Nov 30, 2017 at 5:02 AM Ramanathan Muthaiah <[hidden email]> wrote:
Is it possible to capture the return value from pipeline step?

ex:
def result = findbugs(pattern: '**/target/**/findbugsXml.xml')
echo result

To store cmd status or output, you should use sh(). You will find code snippets in this link, https://jenkins.io/doc/pipeline/examples/

BTW, Jenkins Pipeline doc has step called, "findFiles" but there is nothing like, findbugs. Is that your custom function?

/Ram
 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/fc1b0b4e-bb5b-4f23-b408-ab9965d8692b%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 Users" 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-users/CAO49JtEycsvijKPUWERq%2BhtEpErkGs%2BMYEzCw6PAVDRKSj8X_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Return value from step (pipeline)

Ulli Hafner
In reply to this post by sreeram yerrapragada
This is not yet possible. The findbugs step does not return anything currently. This will change in a future version of findbugs. 

 
If you have any requirements that are not yet considered please update the wiki page.

Am 30.11.2017 um 09:12 schrieb sreeram yerrapragada <[hidden email]>:

Hello Jenkins Users,

Is it possible to capture the return value from pipeline step?

ex:
def result = findbugs(pattern: '**/target/**/findbugsXml.xml')
echo result


Thanks
Sreeram

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e9e3a605-66ae-4cb4-a2aa-6574d604dcd0%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 Users" 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-users/0874024C-B4FC-46C1-B7AD-9A7020AA4F2D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.