X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fhelm%2Fplugins%2Fdeploy%2Fdeploy.sh;h=5820e7752135d5d1172c23e5d9cfbf5928744518;hb=7bf306eeb0f6be832558c6edb48b78f5909b2831;hp=4fec3984db941605051b6b30cd38dc298a037d8d;hpb=ae7b05560d7c7d59c7ceaa7d7e40bdce67e7d399;p=oom.git diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh index 4fec3984db..5820e77521 100755 --- a/kubernetes/helm/plugins/deploy/deploy.sh +++ b/kubernetes/helm/plugins/deploy/deploy.sh @@ -22,13 +22,13 @@ You can specify the '--values'/'-f' flag multiple times. The priority will be gi last (right-most) file specified. For example, if both myvalues.yaml and override.yaml contained a key called 'Test', the value set in override.yaml would take precedence: - $ helm deploy demo ./onap --namespace onap -f openstack.yaml -f overrides.yaml + $ helm deploy demo ./onap --namespace onap -f openstack.yaml -f overrides.yaml You can specify the '--set' flag multiple times. The priority will be given to the last (right-most) set specified. For example, if both 'bar' and 'newbar' values are set for a key called 'foo', the 'newbar' value would take precedence: - $ helm deploy demo local/onap --namespace onap -f overrides.yaml --set log.enabled=false --set vid.enabled=false + $ helm deploy demo local/onap --namespace onap -f overrides.yaml --set log.enabled=false --set vid.enabled=false Usage: helm deploy [RELEASE] [CHART] [flags] @@ -89,16 +89,16 @@ resolve_deploy_flags() { deploy() { # validate params - if [ -z "$1" ] || [ -z "$2" ]; then + if [ -z "$1" ] || [ -z "$2" ]; then usage - exit 0 + exit 1 fi RELEASE=$1 CHART_URL=$2 - FLAGS=${@:3} - CHART_REPO="$(echo "$CHART_URL" |cut -d'/' -f1)" - CHART_NAME="$(echo "$CHART_URL" |cut -d'/' -f2)" + FLAGS=$(echo ${@} | sed 's/^ *[^ ]* *[^ ]* *//') + CHART_REPO="$(echo "$CHART_URL" | cut -d'/' -f1)" + CHART_NAME="$(echo "$CHART_URL" | cut -d'/' -f2)" if expr "$HELM_VER" : "v3\..*" ; then CACHE_DIR=~/.local/share/helm/plugins/deploy/cache else @@ -123,7 +123,7 @@ deploy() { fi # determine if set-last-applied flag is enabled SET_LAST_APPLIED="false" - if expr"$FLAGS" : ".*--set-last-applied.*" ; then + if expr "$FLAGS" : ".*--set-last-applied.*" ; then FLAGS="$(echo $FLAGS| sed -n 's/--set-last-applied//p')" SET_LAST_APPLIED="true" fi @@ -242,17 +242,17 @@ deploy() { else echo "release \"${RELEASE}-${subchart}\" deployed" fi - # Add annotation last-applied-configuration if set-last-applied flag is set + # Add annotation last-applied-configuration if set-last-applied flag is set if [ "$SET_LAST_APPLIED" = "true" ]; then helm get manifest "${RELEASE}-${subchart}" \ | kubectl apply set-last-applied --create-annotation -n onap -f - \ - > $LOG_FILE.log 2>&1 + > $LOG_FILE.log 2>&1 fi fi - if [ "$DELAY" = "true" ]; then - echo sleep 3m - sleep 180 - fi + if [ "$DELAY" = "true" ]; then + echo sleep 3m + sleep 180 + fi else array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}")) n=${#array[*]} @@ -287,7 +287,7 @@ case "${1:-"help"}" in usage ;; *) - deploy $1 $2 ${@:3} + deploy $1 $2 $(echo ${@} | sed 's/^ *[^ ]* *[^ ]* *//') ;; esac