chore: refine create-chart.sh

This commit is contained in:
Chi-En Wu
2020-04-28 17:16:07 +08:00
parent 5982f7bc13
commit 4862f467c9
+12 -8
View File
@@ -1,16 +1,20 @@
#!/usr/bin/env bash
set -exu
set -eu
if [[ $# -eq 0 ]]
then
echo "No argument supplied"
exit 1
echo "Usage: create-chart.sh <chartname>"
exit 1
fi
mkdir "$1"
curl --proto '=https' --tlsv1.2 -sSf https://codeload.github.com/hahow/common-chart/tar.gz/master | \
tar -xz -C "$1" --strip=2 common-chart-master/starter
find "$1" -type f | xargs sed -i "" "s/<CHARTNAME>/$1/g"
CHART_NAME=$1
helm dep build "$1"
echo "Creating chart..."
mkdir "$CHART_NAME"
curl --proto '=https' --tlsv1.2 -sSf https://codeload.github.com/hahow/common-chart/tar.gz/master | \
tar -xz -C "$CHART_NAME" --strip=2 common-chart-master/starter
find "$CHART_NAME" -type f | xargs sed -i"" "s/<CHARTNAME>/$CHART_NAME/g"
echo "Building dependencies..."
helm dep build "$CHART_NAME"