forked from hortonworks/cloudbreak-deployer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
33 lines (26 loc) · 815 Bytes
/
install
File metadata and controls
33 lines (26 loc) · 815 Bytes
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
: ${GIT_ORG:=sequenceiq}
: ${GIT_PROJECT:=cloudbreak-deployer}
main() {
local redirect=$(
curl -s \
-o /dev/null \
-w "%{redirect_url}" \
https://github.com/sequenceiq/cloudbreak-deployer/releases/latest
)
local latest=${redirect##*v}
local osarch=$(uname -sm|tr " " _)
local url="https://github.com/${GIT_ORG}/${GIT_PROJECT}/releases/download/v${latest}/${GIT_PROJECT}_${latest}_${osarch}.tgz"
local dest=/bin
hash -r > /dev/null
if (command -v cbd > /dev/null); then
local existing=$(command -v cbd)
dest=${existing%/*}
else
if echo "$PATH" | grep -q '/usr/local/bin' ; then
dest=/usr/local/bin
fi
fi
curl -Ls $url | tar -xz -C ${dest}
echo "---> cbd installed into ${dest}"
}
main