File tree Expand file tree Collapse file tree 1 file changed +46
-2
lines changed Expand file tree Collapse file tree 1 file changed +46
-2
lines changed Original file line number Diff line number Diff line change 16
16
if [ -f " kustomize" ]; then
17
17
rm kustomize
18
18
fi
19
- echo " installing latest version of kustomize"
20
- curl -s " https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
19
+
20
+ echo " installing kustomize"
21
+
22
+ where=$PWD
23
+ if [ -f $where /kustomize ]; then
24
+ echo " A file named kustomize already exists (remove it first)."
25
+ exit 1
26
+ fi
27
+
28
+ tmpDir=` mktemp -d`
29
+ if [[ ! " $tmpDir " || ! -d " $tmpDir " ]]; then
30
+ echo " Could not create temp dir."
31
+ exit 1
32
+ fi
33
+
34
+ function cleanup {
35
+ rm -rf " $tmpDir "
36
+ }
37
+
38
+ trap cleanup EXIT
39
+
40
+ pushd $tmpDir >& /dev/null
41
+
42
+ opsys=windows
43
+ if [[ " $OSTYPE " == linux* ]]; then
44
+ opsys=linux
45
+ elif [[ " $OSTYPE " == darwin* ]]; then
46
+ opsys=darwin
47
+ fi
48
+
49
+ curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases | \
50
+ grep browser_download | \
51
+ grep $opsys | \
52
+ cut -d ' "' -f 4 | \
53
+ grep /kustomize/v3.8.0 | \
54
+ sort | tail -n 1 | \
55
+ xargs curl -s -O -L
56
+
57
+ tar xzf ./kustomize_v* _${opsys} _amd64.tar.gz
58
+
59
+ cp ./kustomize $where
60
+
61
+ popd >& /dev/null
62
+
63
+ ./kustomize version
64
+
21
65
mv kustomize " ${INSTALL_DIR} "
You can’t perform that action at this time.
0 commit comments