-
Notifications
You must be signed in to change notification settings - Fork 42
/
install.sh
executable file
·98 lines (87 loc) · 2.12 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/sh
set -eu
CHANNEL=${CHANNEL:-stable}
VERSION=${VERSION:-current}
os=$(uname -s)
arch=$(uname -m)
OS=${OS:-"${os}"}
ARCH=${ARCH:-"${arch}"}
OS_ARCH=""
BIN=${BIN:-up}
unsupported_arch() {
local os=$1
local arch=$2
echo "Up does not support $os / $arch at this time."
exit 1
}
case $OS in
CYGWIN* | MINGW64*)
if [ $ARCH = "amd64" ]
then
OS_ARCH=windows_amd64
BIN=up.exe
else
unsupported_arch $OS $ARCH
fi
;;
Darwin)
case $ARCH in
x86_64|amd64)
OS_ARCH=darwin_amd64
;;
arm64)
OS_ARCH=darwin_arm64
;;
*)
unsupported_arch $OS $ARCH
;;
esac
;;
Linux)
case $ARCH in
x86_64|amd64)
OS_ARCH=linux_amd64
;;
arm64)
OS_ARCH=linux_arm64
;;
*)
unsupported_arch $OS $ARCH
;;
esac
;;
*)
unsupported_arch $OS $ARCH
;;
esac
url="https://cli.upbound.io/${CHANNEL}/${VERSION}/bin/${OS_ARCH}/${BIN}"
if ! curl -sLO ${url}; then
echo "Failed to download Up. Please make sure version ${VERSION} exists on channel ${CHANNEL}."
exit 1
fi
if [ $BIN = "up" ]; then
chmod +x up
echo "Up downloaded successfully!"
echo "By proceeding, you are accepting to comply with terms and conditions in https://licenses.upbound.io/upbound-software-license.html"
echo
echo "Run the following commands to finish installation:"
echo
echo sudo mv up /usr/local/bin/
echo up version
echo
echo "Visit https://upbound.io to get started. 🚀"
echo "Have a nice day! 👋\n"
fi
if [ $BIN = "docker-credential-up" ]; then
chmod +x docker-credential-up
echo "Upbound Docker Credential Helper downloaded successfully!"
echo "By proceeding, you are accepting to comply with terms and conditions in https://licenses.upbound.io/upbound-software-license.html"
echo
echo "Run the following commands to finish installation:"
echo
echo sudo mv docker-credential-up /usr/local/bin/
echo docker-credential-up -v
echo
echo 'Add "xpkg.upbound.io": "up" to the "credHelpers" section of your Docker config file. 🚀'
echo "Have a nice day! 👋\n"
fi