Skip to content
Snippets Groups Projects
Unverified Commit 17e534d4 authored by Julian Tölle's avatar Julian Tölle Committed by GitHub
Browse files

ci: build helm repo index (#391)

We previously relied on the helm-charts repo to re-build the index. But
this has problems:

- The gh-pages pipeline is not properly started because events created
by the default GITHUB_TOKEN do not trigger pipelines (in the same repo).
- Adding the chart and re-indexing happens in two commits, slightly
obfuscating the chain of events
- When running `helm repo index` it updates the created timestamp of all
existing entries. While I have not seen any issues yet, there might be
some clients that rely on this field.
parent afcc1251
Branches
Tags
No related merge requests found
...@@ -17,15 +17,26 @@ TMP_DIR=$(mktemp --directory hccm-chart-repo.XXXXX) ...@@ -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}" 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}" pushd "${TMP_DIR}"
# Setup git-lfs # Setup git-lfs
git lfs install --local git lfs install --local
# commit & push # commit & push
git add "${CHART_FILE}" git add -- index.yaml "${CHART_FILE}"
git commit -m "feat: add ${CHART_FILE}" git commit -m "feat: add ${CHART_FILE}"
git push git push
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment