diff --git a/scripts/publish-helm-chart.sh b/scripts/publish-helm-chart.sh index 4eb0578f7d3e0b60c5fd7b8dc66ec79a8d7fd9ed..41589b306f457468516d2975d81f0274129a98ff 100755 --- a/scripts/publish-helm-chart.sh +++ b/scripts/publish-helm-chart.sh @@ -17,15 +17,26 @@ TMP_DIR=$(mktemp --directory hccm-chart-repo.XXXXX) git clone --depth 1 -b "${CHART_REPO_BRANCH}" "${CHART_REPO_REMOTE}" "${TMP_DIR}" -cp "${CHART_FILE}" "${TMP_DIR}/" +mkdir "${TMP_DIR}"/new-chart +cp "${CHART_FILE}" "${TMP_DIR}/new-chart" +pushd "${TMP_DIR}/new-chart" + +# Update index +# We use --merge to not update any of the other existing entries in the index file, +# this requires us to put our new chart in a separate dir that only includes the new chart. +helm repo index --merge ../index.yaml . +# Move chart and merged index to root dir +mv -f -- * .. + +popd pushd "${TMP_DIR}" # Setup git-lfs git lfs install --local # commit & push -git add "${CHART_FILE}" +git add -- index.yaml "${CHART_FILE}" git commit -m "feat: add ${CHART_FILE}" git push