Skip to content

Commit

Permalink
Improve release charts script readability further
Browse files Browse the repository at this point in the history
  • Loading branch information
thardeck committed Sep 6, 2023
1 parent 25cef1f commit c68b5a1
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/scripts/release-against-charts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,16 @@ else
exit 1
fi

if [ "${REPLACE}" == "true" ]; then
for i in fleet fleet-crd fleet-agent; do
for i in fleet fleet-crd fleet-agent; do
if [ "${REPLACE}" == "true" ]; then
yq --inplace "del( .${i}.[] | select(. == \"${PREV_CHART_VERSION}+up${PREV_FLEET_VERSION}\") )" release.yaml
yq --inplace ".${i} += \"${NEW_CHART_VERSION}+up${NEW_FLEET_VERSION}\"" release.yaml
done
else
for i in fleet fleet-crd fleet-agent; do
yq --inplace ".${i} += \"${NEW_CHART_VERSION}+up${NEW_FLEET_VERSION}\"" release.yaml
done
fi
fi
yq --inplace ".${i} += \"${NEW_CHART_VERSION}+up${NEW_FLEET_VERSION}\"" release.yaml
done

# Follow the currently applied no identation style for arrays in release.yaml,
# which is not possible with yq v4 atm: https://github.com/mikefarah/yq/issues/1309
sed -i "s/^ -/-/g" release.yaml
sed -i "s/^ -/-/" release.yaml

git add packages/fleet release.yaml
git commit -m "Updating to Fleet v${NEW_FLEET_VERSION}"
Expand Down

0 comments on commit c68b5a1

Please sign in to comment.