forked from CloudHealth/helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·38 lines (30 loc) · 912 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
function print_usage_and_exit() {
echo "Failure: $1"
echo "Usage: $0 CHART_NAME"
echo "Example: $0 cloudhealth-collector"
exit 1
}
CHART_NAME=$1
if [[ -z $CHART_NAME ]] ; then
print_usage_and_exit "Chart name is required"
fi
helm_path=`which helm`
if [[ -z helm_path ]] ; then
echo "Failure: helm not found"
exit 1
fi
# initialize build variables
BUILD_DIR="."
INDEX_FILE=${BUILD_DIR}/index.yaml
# create new tgz
echo "creating new ${CHART_NAME} helm package"
helm package -d ${BUILD_DIR} ./${CHART_NAME}
if [[ "$?" -ne "0" ]] ; then
echo "Failure: error creating helm package"
exit 1
fi
echo "generating updated index.yaml"
helm repo index --merge "${INDEX_FILE}" ${BUILD_DIR}
echo "Complete. new index and package files can be found under ${BUILD_DIR}"
echo "Run: 'git checkout CloudHealth/helm && cp ${BUILD_DIR}/* .' and commit to update the helm chart"