From f470cd2533c49d7354c13a8fbe05fad6a280e80d Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Tue, 17 Aug 2021 13:35:13 +0200 Subject: [PATCH] move remove-test to function --- .github/workflows/apps.test.yaml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/apps.test.yaml b/.github/workflows/apps.test.yaml index abd93999783..dc4d83e06ad 100644 --- a/.github/workflows/apps.test.yaml +++ b/.github/workflows/apps.test.yaml @@ -255,20 +255,24 @@ jobs: - name: Remove if release already exists run: | + removetask(){ + if [ -d "$2/SCALE" ]; then + maxchartversion=$(cat $2/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }') + chartname=$(basename $2) + echo "Processing... cleanup-existing... Chart: ${chartname} - Version: ${maxchartversion}" + rm -Rf catalog/$1/${chartname}/${maxchartversion} || echo "Chart release ${chartname} with version ${maxchartversion} does not exist yet... Skipping..." + rm -Rf catalog/$1/${chartname}/item.yaml || echo "No old catalog item.yaml found for ${chartname}" + else + echo "Skipping chart ${chart}, no correct SCALE compatibility layer detected" + fi + } for train in stable incubator develop non-free deprecated do for chart in master/charts/${train}/*; do - if [ -d "${chart}/SCALE" ]; then - maxchartversion=$(cat ${chart}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }') - chartname=$(basename ${chart}) - echo "Processing... cleanup-existing... Chart: ${chartname} - Version: ${maxchartversion}" - rm -Rf catalog/${train}/${chartname}/${maxchartversion} || echo "Chart release ${chartname} with version ${maxchartversion} does not exist yet... Skipping..." - rm -Rf catalog/${train}/${chartname}/item.yaml || echo "No old catalog item.yaml found for ${chartname}" - else - echo "Skipping chart ${chart}, no correct SCALE compatibility layer detected" - fi + removetask "${train}" "${chart}" done done + wait - name: fetch dependencies run: | for train in stable incubator develop non-free deprecated