-
Notifications
You must be signed in to change notification settings - Fork 18
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
script to clean up tarballs of jobs given a PR number #217
Conversation
cleanup_pr.sh
Outdated
# restore potentially parsed filename(s) into $* | ||
set -- "${POSITIONAL_ARGS[@]}" | ||
|
||
if [[ $# -lt 1 ]]; then |
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.
Don't we want exactly 1 PR number here?
If so, use $# -ne 1
, and adjust the error message, like "ERROR: Exactly one PR number should be provided"
.
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.
Done in 1f9c0da
cleanup_pr.sh
Outdated
if ${dry_run} = true ; then | ||
echo "DRY_RUN: rm '$f' ($(ls -lh $f | awk '{print $5}'))" | ||
else | ||
rm $f |
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.
maybe also emit a message when removing a file?
echo "Removing $f..."`
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.
Done in 1f9c0da
@trz42 Next step (maybe in follow-up PR) could be to run this script every time a PR is closed/merged? |
Good idea. We could implement this as follows:
|
@trz42 Should we move the script into the |
To delete all major tarballs (temporary storage and build artefacts such as software installations) of PR
NUMBER
, simply run withfrom bot directory that contains
app.cfg
(used to determine base directory for jobs, e.g., settingjobs_base_dir
).-D
or--dry-run
to check what the script would do.-b DIR
or--jobs-base-dir DIR
whereDIR
points to the base directory of jobs.