Merge pull request #3495 from MaXinjian/install

Add support to install kustomize to specified directory
This commit is contained in:
Jeff Regan
2021-01-26 12:30:46 -08:00
committed by GitHub

View File

@@ -8,19 +8,28 @@
# kustomize binary to your current working directory.
# (e.g. 'install_kustomize.sh 3.8.2')
#
# If two arguments are given -> Downloads the specified version of the
# kustomize binary to the specified directory.
# (e.g. 'install_kustomize.sh 3.8.2 $(go env GOPATH)/bin')
#
# Fails if the file already exists.
curl_timeout=600
release_url=https://api.github.com/repos/kubernetes-sigs/kustomize/releases
version=""
release_url=https://api.github.com/repos/kubernetes-sigs/kustomize/releases
if [ -n "$1" ]; then
version=v$1
release_url=${release_url}/tags/kustomize%2F$version
version=v$1
release_url=${release_url}/tags/kustomize%2F$version
fi
where=$PWD
if [ -n "$2" ]; then
where=$2
fi
if [ -f $where/kustomize ]; then
echo "A file named kustomize already exists (remove it first)."
echo "A file named $where/kustomize already exists (remove it first)."
exit 1
fi
@@ -63,6 +72,6 @@ cp ./kustomize $where
popd >& /dev/null
./kustomize version
$where/kustomize version
echo kustomize installed to current directory.
echo kustomize installed to $where