-
Notifications
You must be signed in to change notification settings - Fork 11
/
install.sh
executable file
·52 lines (49 loc) · 1.55 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
#!/bin/bash
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
if [[ "$OS" == "darwin" ]]; then
if [ -z "$(which jq)" ]; then
brew install jq
fi
if [ -z "$(which ibmcloud)" ]; then
curl -fsSL https://clis.cloud.ibm.com/install/osx | sh
if [ $? -ne 0 ]; then
echo "IBM Cloud CLI installation failed, exiting with a failure"
exit 1;
else
echo "IBM Cloud CLI version $(ibmcloud version) installed successfullly."
fi
fi
elif [[ "$OS" == "linux" ]]; then
if [ -z "$JENKINS_HOME" ]; then
# RHEL Linux
if [ -z "$(which jq)" ]; then
sudo yum install -y jq
fi
else
# Install for Jenkins alpine
if [ -z "$(which jq)" ]; then
apk add jq
fi
fi
if [ -z "$(which ibmcloud)" ]; then
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
if [ $? -ne 0 ]; then
echo "IBM Cloud CLI installation failed, exiting with a failure"
exit 1;
else
echo "IBM Cloud CLI version $(ibmcloud version) installed successfullly."
fi
fi
else
echo "Unsupported OS"
exit 1
fi
ibmcloud version
curl --progress-bar -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
ibmcloud plugin install container-service -f
if [ $? -ne 0 ]; then
echo "IBM Cloud CLI kubernetes plugin installation failed, exiting with a failure"
exit 1;
else
echo "IBM Cloud CLI kubernetes pluing version installed successfullly."
fi