deploy.sh does not work on Mac os x because untar directory is created before helm...
[oom.git] / kubernetes / helm / plugins / deploy / deploy.sh
index 1622689..bb98a3b 100755 (executable)
@@ -140,21 +140,17 @@ deploy() {
   # actual upgrade/install of parent and subcharts.
   DEPLOY_FLAGS=$(resolve_deploy_flags "$FLAGS")
 
- # determine if upgrading individual subchart or entire parent + subcharts
 # determine if upgrading individual subchart or entire parent + subcharts
   SUBCHART_RELEASE="$(cut -d'-' -f2 <<<"$RELEASE")"
-  if [[ ! -d "$CACHE_SUBCHART_DIR/$SUBCHART_RELEASE" ]]; then
+  # update specified subchart without parent
+  RELEASE="$(cut -d'-' -f1 <<<"$RELEASE")"
+  if [[ $SUBCHART_RELEASE == $RELEASE ]]; then
     SUBCHART_RELEASE=
-  else
-    # update specified subchart without parent
-    RELEASE="$(cut -d'-' -f1 <<<"$RELEASE")"
   fi
 
   # clear previously cached charts
   rm -rf $CACHE_DIR
 
-  # create log driectory
-  mkdir -p $LOG_DIR
-
   # fetch umbrella chart (parent chart containing subcharts)
   if [[ -d "$CHART_URL" ]]; then
     mkdir -p $CHART_DIR
@@ -170,6 +166,9 @@ deploy() {
     helm fetch $CHART_URL --untar --untardir $CACHE_DIR $VERSION
   fi
 
+  # create log driectory
+  mkdir -p $LOG_DIR
+
   # move out subcharts to process separately
   mkdir -p $CACHE_SUBCHART_DIR
   mv $CHART_DIR/charts/* $CACHE_SUBCHART_DIR/