Pipeline retry step

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

Pipeline retry step

Graham Hay-2
https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#retry-retry-the-body-up-to-n-times

Can someone clarify for me what retry(1) will do? Will that run the step twice, if it fails? Or does the count include the original attempt? (I tried to find the source code, but didn't even know where to start).

Thanks,

Graham

--
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/4f974b15-a376-47ff-b6ea-199715275225n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

RE: Pipeline retry step

Gianluca

Hi Graham,

I have no ide … but why not test it?

It’s quite straightforward:

 

Retry(1) {

   Error(“This will fail … but how many times you will see this text?”)

}

 

Cheers,

Gianluca.

 

 

From: [hidden email] <[hidden email]> On Behalf Of Graham Hay
Sent: 08 February 2021 12:50
To: Jenkins Users <[hidden email]>
Subject: Pipeline retry step

 

https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#retry-retry-the-body-up-to-n-times

Can someone clarify for me what retry(1) will do? Will that run the step twice, if it fails? Or does the count include the original attempt? (I tried to find the source code, but didn't even know where to start).

 

Thanks,

 

Graham

--
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/4f974b15-a376-47ff-b6ea-199715275225n%40googlegroups.com.

--
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/00c401d6fe25%249371c480%24ba554d80%24%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Pipeline retry step

Graham Hay-2
Good idea, thanks.

On Mon, Feb 8, 2021 at 2:19 PM <[hidden email]> wrote:

Hi Graham,

I have no ide … but why not test it?

It’s quite straightforward:

 

Retry(1) {

   Error(“This will fail … but how many times you will see this text?”)

}

 

Cheers,

Gianluca.

 

 

From: [hidden email] <[hidden email]> On Behalf Of Graham Hay
Sent: 08 February 2021 12:50
To: Jenkins Users <[hidden email]>
Subject: Pipeline retry step

 

https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#retry-retry-the-body-up-to-n-times

Can someone clarify for me what retry(1) will do? Will that run the step twice, if it fails? Or does the count include the original attempt? (I tried to find the source code, but didn't even know where to start).

 

Thanks,

 

Graham

--
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/4f974b15-a376-47ff-b6ea-199715275225n%40googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/Ku2uzb00f2A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/00c401d6fe25%249371c480%24ba554d80%24%40gmail.com.

--
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/CAJ4H%2BnqXcdfqwShnGLmazZ9qJWFjun-Lx5oQpPQhThbFRJMZKQ%40mail.gmail.com.