-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-17293: [Java][CI] Prune java nightly builds (#13839)
Prune java nightly builds Authored-by: david dali susanibar arce <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
- Loading branch information
1 parent
15d6959
commit d7eea09
Showing
1 changed file
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,10 @@ on: | |
description: Job prefix to use. | ||
required: false | ||
default: '' | ||
keep: | ||
description: Number of versions to keep. | ||
required: false | ||
default: 14 | ||
schedule: | ||
- cron: '0 14 * * *' | ||
jobs: | ||
|
@@ -64,6 +68,31 @@ jobs: | |
fi | ||
echo $PREFIX | ||
archery crossbow download-artifacts -f java-jars -t binaries $PREFIX | ||
- name: Cache Repo | ||
uses: actions/cache@v3 | ||
with: | ||
path: repo | ||
key: java-nightly-${{ github.run_id }} | ||
restore-keys: java-nightly | ||
- name: Sync from Remote | ||
uses: ./arrow/.github/actions/sync-nightlies | ||
with: | ||
switches: -avzh --update --delete --progress | ||
local_path: repo | ||
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/java | ||
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} | ||
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} | ||
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} | ||
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} | ||
remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }} | ||
- shell: bash | ||
name: Show local repo sync from remote | ||
run: | | ||
for i in `ls -t repo/org/apache/arrow`; do | ||
echo "- $i: $(find repo/org/apache/arrow/$i -mindepth 1 -maxdepth 1 -type d \ | ||
| wc -l \ | ||
| xargs) versions available" | ||
done | ||
- shell: bash | ||
name: Build Repository | ||
run: | | ||
|
@@ -78,16 +107,29 @@ jobs: | |
cp binaries/$PREFIX/java-jars/$LIBRARY repo/org/apache/arrow/${BASH_REMATCH[1]}/${BASH_REMATCH[2]} | ||
echo "Artifacts $LIBRARY configured" | ||
done | ||
- name: Prune Repository | ||
shell: bash | ||
env: | ||
KEEP: ${{ github.event.inputs.keep || 14 }} | ||
run: | | ||
for i in `ls -t repo/org/apache/arrow`; do | ||
find repo/org/apache/arrow/$i -mindepth 1 -maxdepth 1 -type d -print0 \ | ||
| xargs -0 ls -t -d \ | ||
| tail -n +$((KEEP + 1)) \ | ||
| xargs rm -rf | ||
done | ||
- name: Show repo contents | ||
run: tree repo | ||
- name: Upload Files | ||
- name: Sync to Remote | ||
if: ${{ github.repository == 'apache/arrow' }} | ||
uses: burnett01/[email protected] | ||
uses: ./arrow/.github/actions/sync-nightlies | ||
with: | ||
switches: -avzr | ||
path: repo/* | ||
upload: true | ||
switches: -avzh --update --delete --progress | ||
local_path: repo | ||
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/java | ||
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} | ||
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} | ||
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} | ||
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} | ||
remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }} |