I am trying to install kustomize in CircleCI.
I tried the following method.
https://github.com/kubernetes-sigs/kustomize/blob/master/docs/INSTALL.md
opsys=linux # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/latest |\
grep browser_download |\
grep $opsys |\
cut -d '"' -f 4 |\
xargs curl -O -L
mv kustomize_*_${opsys}_amd64 kustomize
chmod u+x kustomize
However, browser_download did not exist in v3.0.3.
Is there a change from v3.0.2?
+1
The binary hasn't been uploaded with the release, so this way of installing it crash 馃槗
@davinkevin
Resolved by using grep to get the corresponding first line.
When using a pipe, it will temporarily output to a file because it will reach the capacity limit.😔
opsys=linux
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases > curl.txt && \
grep browser_download -m5 curl.txt |\
grep $opsys -m1 |\
cut -d '"' -f 4 |\
xargs curl -O -L
mv kustomize_*_${opsys}_amd64 kustomize
chmod u+x kustomize
rm curl.txt
The release has been created with tag 3.0.3 instead of v3.0.3 it seems
I fix it with a head -n 1
opsys=linux # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
grep browser_download |\
grep $opsys |\
cut -d '"' -f 4 |\
head -n 1 |\
xargs curl -O -L
mv kustomize_*_${opsys}_amd64 kustomize
chmod u+x kustomize
@looztra fixed the release for v3.0.3.
I could download and use kustomize until two weeks ago, but today I failed.
So, I did this command for check
opsys=linux # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
grep browser_download |\
grep $opsys |\
cut -d '"' -f 4 |\
head -n 1
https://github.com/kubernetes-sigs/kustomize/releases/download/pluginator/v1.1.0/pluginator_v1.1.0_linux_amd64.tar.gz
I got pluginator_v1.1.0_linux_amd64.tar.gz. So, to avoid pluginator, I add grep kustomize_, but got tar.gz
opsys=linux # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
grep browser_download |\
grep $opsys |\
cut -d '"' -f 4 |\
grep kustomize_ |\
grep -v tar.gz |\
head -n 1
https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.3.0/kustomize_v3.3.0_linux_amd64.tar.gz
Finally, I fixed this with grep -v tar.gz
opsys=linux # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases |\
grep browser_download |\
grep $opsys |\
cut -d '"' -f 4 |\
grep kustomize_ |\
grep -v tar.gz |\
head -n 1 |\
xargs curl -O -L
mv kustomize_*_${opsys}_amd64 kustomize
chmod u+x kustomize
--Postscript--
I found this official. ( overlooked )
https://github.com/kubernetes-sigs/kustomize/blob/master/docs/INSTALL.md#quickly-curl-the-latest-binary
Most helpful comment
@looztra fixed the release for v3.0.3.