Skip to content

Commit

Permalink
Chart script.
Browse files Browse the repository at this point in the history
  • Loading branch information
udhos committed Feb 17, 2024
1 parent 52b142f commit bcd48b3
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions scripts/update-charts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# the ./docs dir is published as https://udhos.github.io/kubecache/

chart_dir=charts/kubecache
chart_url=https://udhos.github.io/kubecache/

# generate new chart package from source into ./docs
helm package $chart_dir -d ./docs

#
# copy new chart into ./charts-tmp
#

chart_name=$(gojq --yaml-input -r .name < $chart_dir/Chart.yaml)
chart_version=$(gojq --yaml-input -r .version < $chart_dir/Chart.yaml)
chart_pkg=${chart_name}-${chart_version}.tgz
rm -rf charts-tmp
mkdir -p charts-tmp
cp docs/${chart_pkg} charts-tmp

#
# merge new chart index into docs/index.yaml
#

git checkout docs/index.yaml ;# reset index

# regenerate the index from existing chart packages
helm repo index charts-tmp --url $chart_url --merge docs/index.yaml

# new merged chart index was generated as ./charts-tmp/index.yaml,
# copy it back to ./docs
cp charts-tmp/index.yaml docs

echo "#"
echo "# check that ./docs is fine then:"
echo "#"
echo "git add docs"
echo "git commit -m 'Update chart repository.'"
echo "git push"

0 comments on commit bcd48b3

Please sign in to comment.