From ea523a46b0f7bc2e2717b437c9c02924eda6807e Mon Sep 17 00:00:00 2001 From: Alejandro Pedraza Date: Fri, 21 Feb 2020 09:51:21 -0500 Subject: [PATCH] Fixed shellcheck warnings on bin/helm-build (#4080) Followup to #4058 ``` $ shellcheck -x bin/helm-build; echo $? 0 ``` --- bin/helm-build | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/helm-build b/bin/helm-build index 40dde73bf..7d13406ff 100755 --- a/bin/helm-build +++ b/bin/helm-build @@ -9,7 +9,7 @@ setValues() { showErr() { printf "Error on exit:\n Exit code: %d\n Failed command: \"%s\"\n" $? "$BASH_COMMAND" - setValues $fullVersion "{version}" + setValues "$fullVersion" "{version}" } # trap the last failed command @@ -29,6 +29,7 @@ rootdir=$( cd "$bindir"/.. && pwd ) # `bin/helm-build package` assumes the presence of "$rootdir"/target/helm/index-pre.yaml which is downloaded in the chart_deploy CI job if [ "$1" = package ]; then + # shellcheck source=bin/_tag.sh . "$bindir"/_tag.sh tag=$(named_tag) clean_head || { echo 'There are uncommitted changes'; exit 1; } @@ -43,13 +44,13 @@ if [ "$1" = package ]; then version=${BASH_REMATCH[2]} # set version in Values files - setValues "{version}" $fullVersion + setValues "{version}" "$fullVersion" - "$bindir"/helm --version $version --app-version $tag -d "$rootdir"/target/helm package "$rootdir"/charts/linkerd2 - "$bindir"/helm --version $version --app-version $tag -d "$rootdir"/target/helm package "$rootdir"/charts/linkerd2-cni - mv "$rootdir"/target/helm/index-pre.yaml "$rootdir"/target/helm/index-pre-$version.yaml - "$bindir"/helm repo index --url "https://helm.linkerd.io/$repo/" --merge "$rootdir"/target/helm/index-pre-$version.yaml "$rootdir"/target/helm + "$bindir"/helm --version "$version" --app-version "$tag" -d "$rootdir"/target/helm package "$rootdir"/charts/linkerd2 + "$bindir"/helm --version "$version" --app-version "$tag" -d "$rootdir"/target/helm package "$rootdir"/charts/linkerd2-cni + mv "$rootdir"/target/helm/index-pre.yaml "$rootdir"/target/helm/index-pre-"$version".yaml + "$bindir"/helm repo index --url "https://helm.linkerd.io/$repo/" --merge "$rootdir"/target/helm/index-pre-"$version".yaml "$rootdir"/target/helm # restore version in Values files - setValues $fullVersion "{version}" + setValues "$fullVersion" "{version}" fi