有没有办法在詹金斯声明管道中获得重试号码
我正在尝试在Jenkins声明管道中使用重试逻辑,当进行重试时,我需要添加其他逻辑。为此,我需要重试号码,以便可以使用变量添加其他逻辑。作为临时解决方案,我正在尝试按照以下编码来编码,以下面的变量不会增加。请帮忙。
steps{
script{
def counter=0
retry(3){
//my original logic
if (counter.toInteger()>0){
//my additional logic
}
counter = counter + 1
}
}
}
I am trying to use retry logic in jenkins declarative pipeline, when the retry is happening i need to add additional logic. For that I need retry number so that I can use variable to add additional logic. As a temporary solution i am trying to code as below for which counter variable is not getting incremented. Please help.
steps{
script{
def counter=0
retry(3){
//my original logic
if (counter.toInteger()>0){
//my additional logic
}
counter = counter + 1
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我得到了解决方案..希望它对某人有帮助。
I got the solution.. Hope it helps someone.