-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
helmPackage.sh
executable file
·39 lines (31 loc) · 1.02 KB
/
helmPackage.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
39
#!/bin/bash
ARG=$1
function makePackage {
PACKAGE_NAME="$1";
helm package $PACKAGE_NAME;
PACKAGE_VERSION=`ls | grep tgz`;
if [ -e "charts/${PACKAGE_VERSION}" ];
then
NEW_MD5=`md5sum ${PACKAGE_VERSION} | cut -f1 -d' '`;
EXISTING_MD5=`md5sum charts/${PACKAGE_VERSION} | cut -f1 -d' '`;
if [ "$NEW_MD5" != "$EXISTING_MD5" ];
then
if [ "$ARG" = "-f" ];
then
echo "Warning: replacing existing charts/$PACKAGE_VERSION";
mv $PACKAGE_VERSION charts;
else
echo "Chart $PACKAGE_VERSION already exists; update chart version and re-run or use -f to force";
rm $PACKAGE_VERSION;
exit 1;
fi
fi
else
mv $PACKAGE_VERSION charts;
fi
}
makePackage sqlfiddleOpenCore;
rm -rf sqlfiddleCommercialExtension/charts/*.tgz;
cp charts/$PACKAGE_VERSION sqlfiddleCommercialExtension/charts;
makePackage sqlfiddleCommercialExtension;
helm repo index charts;