Pipeline retry step

17 views
Skip to first unread message

Graham Hay

unread,
Feb 8, 2021, 9:15:20 AM2/8/21
to Jenkins Users
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

gma...@gmail.com

unread,
Feb 8, 2021, 9:19:49 AM2/8/21
to jenkins...@googlegroups.com

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.

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

Graham Hay

unread,
Feb 8, 2021, 10:56:25 AM2/8/21
to jenkins...@googlegroups.com
Good idea, thanks.

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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/00c401d6fe25%249371c480%24ba554d80%24%40gmail.com.
Reply all
Reply to author
Forward
0 new messages