mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-18 02:01:29 +00:00
Merge pull request #3227 from radTuti/master
update kustomize download script
This commit is contained in:
@@ -10,11 +10,11 @@
|
|||||||
#
|
#
|
||||||
# Fails if the file already exists.
|
# Fails if the file already exists.
|
||||||
|
|
||||||
|
release_url=https://api.github.com/repos/kubernetes-sigs/kustomize/releases
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
version=v$1
|
version=v$1
|
||||||
else
|
release_url=${release_url}/tags/kustomize%2F$version
|
||||||
version=$(curl -sL -o /dev/null -w %{url_effective} \
|
|
||||||
https://github.com/kubernetes-sigs/kustomize/releases/latest | rev | cut -d/ -f1 | rev)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
where=$PWD
|
where=$PWD
|
||||||
@@ -38,18 +38,18 @@ trap cleanup EXIT
|
|||||||
pushd $tmpDir >& /dev/null
|
pushd $tmpDir >& /dev/null
|
||||||
|
|
||||||
opsys=windows
|
opsys=windows
|
||||||
|
arch=amd64
|
||||||
if [[ "$OSTYPE" == linux* ]]; then
|
if [[ "$OSTYPE" == linux* ]]; then
|
||||||
opsys=linux
|
opsys=linux
|
||||||
elif [[ "$OSTYPE" == darwin* ]]; then
|
elif [[ "$OSTYPE" == darwin* ]]; then
|
||||||
opsys=darwin
|
opsys=darwin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
|
curl -s $release_url |\
|
||||||
grep browser_download |\
|
grep browser_download.*${opsys}_${arch} |\
|
||||||
grep $opsys |\
|
|
||||||
cut -d '"' -f 4 |\
|
cut -d '"' -f 4 |\
|
||||||
grep /kustomize/$version.*amd64 |\
|
sort | tail -n 1 |\
|
||||||
sort | xargs curl -sLO
|
xargs curl -sLO
|
||||||
|
|
||||||
if [ -e ./kustomize_v*_${opsys}_amd64.tar.gz ]; then
|
if [ -e ./kustomize_v*_${opsys}_amd64.tar.gz ]; then
|
||||||
tar xzf ./kustomize_v*_${opsys}_amd64.tar.gz
|
tar xzf ./kustomize_v*_${opsys}_amd64.tar.gz
|
||||||
|
|||||||
Reference in New Issue
Block a user