Skip to content

Commit

Permalink
Fix: do not change timestamps for already existing helm charts
Browse files Browse the repository at this point in the history
The command `helm repo index` is changing timestamps for already existing charts.
This seems to be intended: helm/helm#7363
Helm stable repo tests use this workaround:
https://github.com/helm/charts/blob/c6e503ccfd9911dd06ea9ac389a40a3490637516/test/repo-sync.sh#L83-L90

This commit adds the mentioned workaround to our build.
  • Loading branch information
perk-sumo committed Oct 8, 2020
1 parent c4e8cde commit af14de0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,29 @@ function push_docker_image() {
function push_helm_chart() {
local version="$1"

local sync_dir="${TRAVIS_BUILD_DIR}-helm-sync"

echo "Pushing new Helm Chart release $version"
set -x

git checkout -- .
sudo helm init --client-only
sudo helm repo add falcosecurity https://falcosecurity.github.io/charts
sudo helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
sudo helm package deploy/helm/sumologic --dependency-update --version="$version" --app-version="$version"

# due to helm repo index issue: https://github.com/helm/helm/issues/7363
# we need to create new package in a different dir, merge the index and move the package back
mkdir -p "${sync_dir}"
sudo helm package deploy/helm/sumologic --dependency-update --version="$version" --app-version="$version" --destination "${sync_dir}"

git fetch origin-repo
git checkout gh-pages
sudo helm repo index ./ --url https://sumologic.github.io/sumologic-kubernetes-collection/

sudo helm repo index --url https://sumologic.github.io/sumologic-kubernetes-collection/ --merge ./index.yaml "${sync_dir}"

mv -f "${sync_dir}"/* .
rmdir "${sync_dir}"

git add -A
git commit -m "Push new Helm Chart release $version"
git push --quiet origin-repo gh-pages
Expand Down

0 comments on commit af14de0

Please sign in to comment.