From 1b83a83354d9526fa171f2c46f9fc5d1a6b5dd50 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Sat, 7 Sep 2024 22:00:59 -0400 Subject: [PATCH] [ci] Move nightly cleanup task to monorepo --- .../wpilib-generic-gradle-cache_unused.aql | 20 +++++++++++ .../aql/wpilib-mvn-development_unused.aql | 29 ++++++++++++++++ .../workflows/artifactory-nightly-cleanup.yml | 33 +++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 .github/workflows/aql/wpilib-generic-gradle-cache_unused.aql create mode 100644 .github/workflows/aql/wpilib-mvn-development_unused.aql create mode 100644 .github/workflows/artifactory-nightly-cleanup.yml diff --git a/.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql b/.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql new file mode 100644 index 00000000000..e55f8a4674e --- /dev/null +++ b/.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql @@ -0,0 +1,20 @@ +{ + "files": [ + { + "aql": { + "items.find": { + "repo": "wpilib-generic-gradlecache", + "$or":[ + { + "stat.downloaded": { "$before":"1mo" } + }, + { + "stat.downloaded": { "$eq":null } + } + ], + "created": { "$before":"1mo" } + } + } + } + ] +} \ No newline at end of file diff --git a/.github/workflows/aql/wpilib-mvn-development_unused.aql b/.github/workflows/aql/wpilib-mvn-development_unused.aql new file mode 100644 index 00000000000..c807092c331 --- /dev/null +++ b/.github/workflows/aql/wpilib-mvn-development_unused.aql @@ -0,0 +1,29 @@ +{ + "files": [ + { + "aql": { + "items.find": { + "repo": "wpilib-mvn-development", + "path": { "$nmatch":"*edu/wpi/first/thirdparty*" }, + "$or":[ + { + "artifact.module.build.name": { "$eq":"allwpilib" } + }, + { + "artifact.module.build.name": { "$eq":"combiner" } + } + ], + "$or":[ + { + "stat.downloaded": { "$before":"3mo" } + }, + { + "stat.downloaded": { "$eq":null } + } + ], + "created": { "$before":"3mo" } + } + } + } + ] +} \ No newline at end of file diff --git a/.github/workflows/artifactory-nightly-cleanup.yml b/.github/workflows/artifactory-nightly-cleanup.yml new file mode 100644 index 00000000000..a1ca9cdd27d --- /dev/null +++ b/.github/workflows/artifactory-nightly-cleanup.yml @@ -0,0 +1,33 @@ +name: Artifactory Nightly Cleanup + +on: + workflow_dispatch: + schedule: + - cron: '15 2 * * *' + +jobs: + wpilib-mvn-development_unused_cleanup: + runs-on: ubuntu-latest + if: github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: jfrog/setup-jfrog-cli@v4 + env: + JF_ENV_1: !! REPLACE ME !! + - name: Cleanup + run: jf rt del --spec=.github/workflows/aql/wpilib-mvn-development_unused.aql + + wpilib-generic-gradle-cache_unused_cleanup: + runs-on: ubuntu-latest + if: github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: jfrog/setup-jfrog-cli@v4 + env: + JF_ENV_1: !! REPLACE ME !! + - name: Cleanup + run: jf rt del --spec=.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql