Skip to content

Commit

Permalink
ARROW-17293: [Java][CI] Prune java nightly builds (#13839)
Browse files Browse the repository at this point in the history
Prune java nightly builds

Authored-by: david dali susanibar arce <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
davisusanibar authored Aug 30, 2022
1 parent 15d6959 commit d7eea09
Showing 1 changed file with 46 additions and 4 deletions.
50 changes: 46 additions & 4 deletions .github/workflows/java_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand All @@ -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 }}

0 comments on commit d7eea09

Please sign in to comment.