From 9236f9fa51d306f525786e88ef5ec4cf6b9cb4ad Mon Sep 17 00:00:00 2001 From: Akhil Raj Date: Tue, 30 Apr 2024 13:02:57 +0530 Subject: [PATCH] updating the pipeline for charts --- .github/workflows/helm-index.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/helm-index.yml b/.github/workflows/helm-index.yml index 9cb4c55..789e404 100644 --- a/.github/workflows/helm-index.yml +++ b/.github/workflows/helm-index.yml @@ -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 "devops.bot@getjavelin.io" 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 .