Skip to content

Commit

Permalink
updating the pipeline for charts
Browse files Browse the repository at this point in the history
  • 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.
12 changes: 2 additions & 10 deletions .github/workflows/helm-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 .
Expand Down

0 comments on commit 9236f9f

Please sign in to comment.