-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix(ci): list files in the directory without glob pattern #28129
Conversation
This pull request does not have a backport label. Could you fix it @mdelapenya? 🙏
NOTE: |
Jenkinsfile
Outdated
dir("${BASE_DIR}"){ | ||
cmd(label: "List files to upload", script: "ls -l ${BASE_DIR}/${fileName}") | ||
cmd(label: "List files to upload", script: "ls -l ${BASE_DIR}/${uploadDirName}") |
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.
IIRC this step is launched also on windows system, so ls
could fail (depends on the windows version)
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.
Ah good point! I will refactor it to be cross-platform, 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.
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.
I see this step will retrieve an empty array in the case of no entries: https://github.com/jenkinsci/pipeline-utility-steps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/pipeline/utility/steps/fs/FindFilesStepExecution.java#L63
I think we can use it, thanks!
This step comes from the `pipeline-utility-steps` plugin
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
* fix(ci): list files in the directory without glob pattern * chore: use built-in step to list files This step comes from the `pipeline-utility-steps` plugin * chore: print files (cherry picked from commit 25bc249)
* fix(ci): list files in the directory without glob pattern * chore: use built-in step to list files This step comes from the `pipeline-utility-steps` plugin * chore: print files (cherry picked from commit 25bc249) # Conflicts: # Jenkinsfile
* fix(ci): list files in the directory without glob pattern * chore: use built-in step to list files This step comes from the `pipeline-utility-steps` plugin * chore: print files (cherry picked from commit 25bc249)
What does this PR do?
Instead of using a glob pattern to list the
system-tests-*.tar.gz
files to upload to the GCP bucket, it limits thels
command to the parent dir (build
).Why is it important?
With the previous command, we have noticed errors in the Groovy execution when there are no files matching the glob pattern, causing to fail the upload step.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
Screenshots
From CI build: https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats/detail/PR-28124/2/pipeline/
Logs