Skip to content
Snippets Groups Projects
Commit 60db5c7a authored by Sebastian Kehr's avatar Sebastian Kehr :rowboat_tone2:
Browse files

enable --set-file and --values arguments and retain order

parent 3a960861
No related merge requests found
Pipeline #754 canceled with stages
...@@ -11,10 +11,9 @@ ca_file="${HOME}/k8s-ca.crt" ...@@ -11,10 +11,9 @@ ca_file="${HOME}/k8s-ca.crt"
image_file="" image_file=""
dockerconfig="" dockerconfig=""
tags="" tags=""
valueargs=""
buildargs="" buildargs=""
charts="" charts=""
sets=""
setstrings=""
name="" name=""
certificate_authority="" certificate_authority=""
token="" token=""
...@@ -29,7 +28,7 @@ if [[ ${PIPESTATUS[0]} -ne 4 ]]; then ...@@ -29,7 +28,7 @@ if [[ ${PIPESTATUS[0]} -ne 4 ]]; then
fi fi
OPTIONS= OPTIONS=
LONGOPTS=docker-config:,tag:,build-arg:,set:,set-string:,charts:,name:,token:,certificate-authority:,namespace:,cluster-url:,service-account:,output:,input: LONGOPTS=docker-config:,tag:,build-arg:,values:,set:,set-string:,:set-file,charts:,name:,token:,certificate-authority:,namespace:,cluster-url:,service-account:,output:,input:
# -use ! and PIPESTATUS to get exit code with errexit set # -use ! and PIPESTATUS to get exit code with errexit set
# -temporarily store output to be able to check for errors # -temporarily store output to be able to check for errors
...@@ -59,14 +58,10 @@ while true; do ...@@ -59,14 +58,10 @@ while true; do
buildargs="${buildargs} $2" buildargs="${buildargs} $2"
shift 2 shift 2
;; ;;
-s|--set) -f|--values|-s|--set|--set-string|--set-file)
sets="${sets} $2" valueargs="${valueargs} $1 $2"
shift 2 shift 2
;; ;;
--set-string)
setstrings="${setstrings} $2"
shift 2
;;
-c|--charts) -c|--charts)
charts="$2" charts="$2"
shift 2 shift 2
...@@ -244,17 +239,9 @@ helm_deploy() { ...@@ -244,17 +239,9 @@ helm_deploy() {
fi fi
fi fi
cmd="helm upgrade --install --wait --timeout=60 --tiller-namespace=${namespace} --namespace=${namespace}" valueargs=$(echo -e "$valueargs" | sed -E 's/(^[[:space:]]*)|([[:space:]]*$)//g')
cmd="helm upgrade --install --wait --timeout=60 --tiller-namespace=${namespace}"
for set in ${sets};do cmd="$cmd --namespace=${namespace} ${name} ${charts} ${valueargs}"
cmd="$cmd --set ${set}"
done
for setstring in ${setstrings}; do
cmd="$cmd --set-string ${setstring}"
done
cmd="$cmd ${name} ${charts}"
out=`$cmd 2>&1` out=`$cmd 2>&1`
if [ "$?" != "0" ];then if [ "$?" != "0" ];then
......
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