-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathinstall.sh
executable file
·56 lines (49 loc) · 1.93 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
#!/bin/bash
# Color codes for bash output
BLUE='\e[36m'
GREEN='\e[32m'
RED='\e[31m'
YELLOW='\e[33m'
CLEAR='\e[39m'
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
if [[ "$OS" == "darwin" ]]; then
if [ -z "$(which jq)" ]; then
brew install jq
else
printf "${GREEN}jq version `jq --version` already installed${CLEAR}\n"
fi
if [ -z "$(which kubectl)" ]; then
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/darwin/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
echo "kubectl version: " `kubectl version --client`
else
printf "${GREEN}kubectl version `kubectl version --client` already installed ${CLEAR}\n"
fi
if [ -z "$(which ocm)" ]; then
curl -Lo /usr/local/bin/ocm https://github.com/openshift-online/ocm-cli/releases/download/v0.1.63/ocm-$OS-amd64
chmod +x /usr/local/bin/ocm
printf "${GREEN}ocm version `ocm version` installed${CLEAR}\n"
else
printf "${GREEN}ocm version `ocm version` already installed${CLEAR}\n"
fi
else
if [ -z "$(which jq)" ]; then
sudo yum install -y jq
fi
if [ -z "$(which kubectl)" ]; then
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.20.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
printf "${GREEN}kubectl installed with the following version:\n$(kubectl version --client)${CLEAR}\n"
else
printf "${GREEN}kubectl version `kubectl version --client` already installed ${CLEAR}\n"
fi
if [ -z "$(which ocm)" ]; then
curl -Lo /usr/local/bin/ocm https://github.com/openshift-online/ocm-cli/releases/download/v0.1.63/ocm-$OS-amd64
chmod +x /usr/local/bin/ocm
printf "${GREEN}ocm version `ocm version` installed${CLEAR}\n"
else
printf "${GREEN}ocm version `ocm version` already installed${CLEAR}\n"
fi
fi