New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Created a general function for retrying commands #7208
Conversation
Hi @AdamBrousseau. Thanks! |
27b74e1
to
8904a3f
Compare
Hi @AdamBrousseau! The order has been changed. Thanks! |
} else { | ||
ret = true | ||
} | ||
command() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indenting needs to be fixed
@@ -606,6 +606,18 @@ def generate_test_jobs(TARGET_NAMES, SPEC, ARTIFACTORY_SERVER, ARTIFACTORY_REPO) | |||
} | |||
} | |||
|
|||
def retry_and_delay(command, numRetries = 3, waitTime = 60, units = 'SECONDS') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a comment about how to use this function.
def ret = false | ||
retry(numRetries) { | ||
if (ret) { | ||
sleep time: waitTime,unit: units |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitepsace after comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for find those mistakes! I have fixed them. Thanks for checking it again~
8578e6d
to
bf8f94f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are merged now. |
Thanks! |
07fcdcb
to
e64db12
Compare
Hey @AdamBrousseau! I replaced both of them. Thanks for checking! :) |
Jenkins compile plinux jdk11 |
e64db12
to
1cbf0c3
Compare
Hey @AdamBrousseau! Sorry, I made a mistake of calling the function. I fixed it. Thanks! |
Jenkins compile plinux jdk11 |
} | ||
jobDsl targets: templatePath, ignoreExisting: false, additionalParameters: params | ||
} | ||
retry_and_delay({jobDsl targets: templatePath, ignoreExisting: false, additionalParameters: params}, 3, 120) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll have to check if pipeline-functions.groovy
is loaded at this point in the build and what variable it's loaded into. Same comment for build.groovy. Look for a load
step
ex buildFile = load 'buildenv/jenkins/common/pipeline-functions.groovy'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Adam! I think pipeline-functions.groovy
is not loaded when it fails. I checked the console output and there is no such line
load 'buildenv/jenkins/common/pipeline-functions.groovy'
. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so we'll have to make sure we load that library in those files so we can utilize this new function.
555548e
to
8e47549
Compare
Hey @AdamBrousseau! Thanks for checking it! |
Jenkins compile plinux jdk11 |
8e47549
to
df0abcb
Compare
Jenkins compile plinux jdk11 |
df0abcb
to
1670424
Compare
Jenkins compile plinux jdk11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. PR build tests the 2 function calls.
The commits can be squashed, I don't think we need to have all three merged. Also, a different formatting for
|
Thanks for the advice! I will make the change now. |
44068b6
to
acc6fb5
Compare
Rewrote the retries for uploading to artifactory and creating jobs [skip ci] Signed-off-by: Jenny Chen <Jenny.Chen@ibm.com>
acc6fb5
to
490a5ef
Compare
Hi @pshipton! I have made the change. Thanks! |
[skip ci]
Signed-off-by: Jenny Chen Jenny.Chen@ibm.com