Browse Source

Merge pull request #13814 from jakesmith/hpcc-24149-startall-changes

HPCC-24149 startall.sh improvements

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 years ago
parent
commit
c53311247f
1 changed files with 31 additions and 4 deletions
  1. 31 4
      dockerfiles/startall.sh

+ 31 - 4
dockerfiles/startall.sh

@@ -20,11 +20,38 @@
 # Utility script for starting a local cluster corresponding to current git branch
 # Usage startup.sh [<image.version>] [<helm-install-options>]
 
-LABEL=$1
-[[ -z ${LABEL} ]] && LABEL=$(docker image ls | fgrep 'hpccsystems/platform-core' | head -n 1 | awk '{print $2}')
-shift
+DOCKER_REPO=hpccsystems
+restArgs=()
+
+while [ "$#" -gt 0 ]; do
+  arg=$1
+  if [[ ${arg:0:1} == '-' ]]; then
+    case "${arg:1:1}" in
+      l) shift
+         LABEL=$1
+         ;;
+      d) shift;
+         INPUT_DOCKER_REPO=$1
+         ;;
+      h) echo "Usage: startall.sh [options]"
+         echo "    -d <docker-repo>   Docker repository to fetch images from"
+         echo "    -l                 Build image label to use"
+         exit
+         ;;
+      *) restArgs+=(${arg})
+         ;;
+    esac
+  else
+    restArgs+=(${arg})
+  fi
+  shift
+done
+
+[[ -n ${INPUT_DOCKER_REPO} ]] && DOCKER_REPO=${INPUT_DOCKER_REPO}
+[[ -z ${LABEL} ]] && LABEL=$(docker image ls | fgrep "${DOCKER_REPO}/platform-core" | head -n 1 | awk '{print $2}')
+
+helm install mycluster hpcc/ --set global.image.root="${DOCKER_REPO}" --set global.image.version=$LABEL --set global.privileged=true ${restArgs[@]}
 
-helm install mycluster hpcc/ --set global.image.version=$LABEL --set global.privileged=true $*
 sleep 1
 kubectl get pods