Commit a538d347 authored by Ulf Seltmann's avatar Ulf Seltmann
Browse files

improved helm install/upgrade

parent 67a20bd8
......@@ -220,7 +220,6 @@ prepare_helm() {
prepare_helm_command() {
echo -ne "Preparing helm command..."
cmd="helm --tiller-namespace=${namespace} --namespace=${namespace} --wait"
if [ "${name}" == "" ];then
echo "failed"
......@@ -234,18 +233,7 @@ prepare_helm_command() {
return 1
fi
out=`helm list -a --tiller-namespace ${namespace} --namespace ${namespace}`
if [ "$?" != "0" ];then
echo "failed"
echo "$out"
return 1
fi
if [ "$(echo $out | grep ${name} | grep DEPLOYED)" == "" ];then
cmd="$cmd install -n ${name}"
else
cmd="$cmd upgrade ${name} --recreate-pods"
fi
cmd="helm upgrade --install --wait --tiller-namespace=${namespace} --namespace=${namespace}"
for set in ${sets};do
cmd="$cmd --set ${set}"
......@@ -264,14 +252,15 @@ helm_deploy() {
echo -ne "Deploying ${name}..."
local out=""
if [ "$(helm ls --tiller-namespace=${namespace} --namespace=${namespace} --deleted --failed --short | grep ${name})" != "" ];then
out=`helm delete --tiller-namespace=${namespace} --purge ${name} 2>&1`
if [ "$?" != "0" ];then
echo "failed"
echo "$out"
return 1
fi
fi
# todo: do we need this when we do a "helm upgrade --install" ?
# if [ "$(helm ls --tiller-namespace=${namespace} --namespace=${namespace} --deleted --failed --short | grep ${name})" != "" ];then
# out=`helm delete --tiller-namespace=${namespace} --purge ${name} 2>&1`
# if [ "$?" != "0" ];then
# echo "failed"
# echo "$out"
# return 1
# fi
# fi
out=`$cmd 2>&1`
if [ "$?" != "0" ];then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment