Skip to content
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

Add action to clean nightly assets #1371

Merged

Conversation

qu1queee
Copy link
Contributor

@qu1queee qu1queee commented Sep 1, 2023

Changes

Fixes #1070 (comment)

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Add action to cleanup nightly assets regularly

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 1, 2023
@openshift-ci openshift-ci bot added the release-note Label for when a PR has specified a release note label Sep 1, 2023
@qu1queee qu1queee requested review from SaschaSchwarze0 and removed request for HeavyWombat September 1, 2023 11:32
@qu1queee
Copy link
Contributor Author

qu1queee commented Sep 1, 2023

wrote this pr too fast( busy with other items), but I wanted to ask the following:

  • How many assets we want to keep around? e.g from today till how back in time?

Runs once a week
Deletes everything besides the latest 3 months
Copy link
Member

@adambkaplan adambkaplan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

/lgtm

/kind cleanup

Thanks for finding a quick fix for this @qu1queee!

ASSETS_TOTAL=$(ls $WORK_DIR | wc -l)
echo "[INFO] Currently ${ASSETS_TOTAL} assets for nightly release"

ASSETS_TO_REMOVE=$(ls $WORK_DIR | grep -v "${{ steps.currentmonth.outputs.date }}\|${{ steps.previousmonth.outputs.date }}\|${{ steps.twomonthsago.outputs.date }}" | wc -l)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today I learned: grep -v means "get everything that does not match".

@openshift-ci openshift-ci bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. labels Sep 5, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adambkaplan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2023
@adambkaplan
Copy link
Member

I think keeping everything from the past 3 months is fine. We can iterate further if we want to fine-tune.

@openshift-merge-robot openshift-merge-robot merged commit c79ec2e into shipwright-io:main Sep 5, 2023
12 checks passed
@qu1queee qu1queee deleted the qu1queee/nightly_cleanup branch September 6, 2023 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up Nightly Releases
3 participants