-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Akhil Raj
authored and
Akhil Raj
committed
Apr 30, 2024
1 parent
d7d93c9
commit 9236f9f
Showing
1 changed file
with
2 additions
and
10 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ env: | |
CHARTS_REPO: "getjavelin/charts" | ||
CHARTS_LOCAL_REPO: "charts-repo" | ||
CHARTS_NAME: "javelin-webapp javelin-admin" | ||
CHART_RETENTION: "50" | ||
|
||
jobs: | ||
index-update: | ||
|
@@ -21,14 +22,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
steps: | ||
- name: Set deploy env | ||
id: env_setup | ||
shell: bash | ||
run: |- | ||
if [[ "${{github.base_ref}}" == "main" || "${{github.ref}}" == "refs/heads/main" ]] ; then | ||
echo "purge_count=100" >> ${GITHUB_OUTPUT} | ||
fi | ||
- name: Git Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -49,14 +42,13 @@ jobs: | |
- name: Update Index | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DEVOPS_GITHUB_TOKEN }} | ||
PURGE_COUNT: ${{ steps.env_setup.outputs.purge_count }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "DevOps Bot" | ||
cd ${{ env.CHARTS_LOCAL_REPO }} | ||
git pull | ||
for mychart in ${{ env.CHARTS_NAME }} ; do | ||
ls -trl ${mychart}*.tgz | grep -v latest | awk '{print $9}' | tail -n +${{ env.PURGE_COUNT }} | xargs -I {} rm -- {} | ||
ls -trl ${mychart}*.tgz | grep -v latest | awk '{print $9}' | tail -n +${{ env.CHART_RETENTION }} | xargs -I {} rm -- {} | ||
done | ||
helm repo index . | ||
git add . | ||
|