forked from operator-framework/community-operators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-deps
executable file
·58 lines (53 loc) · 1.96 KB
/
install-deps
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
#!/usr/bin/env bash
set -e
# Don't use sudo when running in a container.
SUDO=sudo
if [ -f /.dockerenv ]; then
SUDO=
fi
# DISTRO_TYPE is either "upstream" or "openshift"
DISTRO_TYPE_UPSTREAM="upstream"
DISTRO_TYPE_OPENSHIFT="openshift"
DISTRO_TYPE="${1:-$DISTRO_TYPE_UPSTREAM}"
if [[ "$DISTRO_TYPE" != "$DISTRO_TYPE_UPSTREAM" && "$DISTRO_TYPE" != "$DISTRO_TYPE_OPENSHIFT" ]]; then
echo "DISTRO_TYPE \"$DISTRO_TYPE\" is not valid. Must be one of: \"$DISTRO_TYPE_UPSTREAM\", \"$DISTRO_TYPE_OPENSHIFT\"."
exit 1
fi
# jq, yq
echo "Installing jq and yq"
curl -Lo jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x jq
$SUDO mv jq /usr/local/bin/
curl -Lo yq https://github.com/mikefarah/yq/releases/download/2.2.1/yq_linux_amd64
chmod +x yq
$SUDO mv yq /usr/local/bin/
# operator-courier
echo "Installing operator-courier"
python3 -m pip install operator-courier
# SDK
echo "Installing operator-sdk"
SDK_VER="v0.6.0"
curl -Lo operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/${SDK_VER}/operator-sdk-${SDK_VER}-x86_64-linux-gnu"
chmod +x operator-sdk
$SUDO mv operator-sdk /usr/local/bin/
# helm
echo "Installing helm"
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
# kubectl
echo "Installing kubectl"
KUBE_VER="v1.13.0"
curl -Lo kubectl "https://storage.googleapis.com/kubernetes-release/release/${KUBE_VER}/bin/linux/amd64/kubectl"
chmod +x kubectl
$SUDO mv kubectl /usr/local/bin/
if [[ "$DISTRO_TYPE" == "$DISTRO_TYPE_UPSTREAM" ]]; then
# minikube and crictl dependency
echo "Installing minikube and crictl"
curl -Lo crictl.tar.gz "https://github.com/kubernetes-sigs/cri-tools/releases/download/${KUBE_VER}/crictl-${KUBE_VER}-linux-amd64.tar.gz"
tar -zxvf crictl.tar.gz
chmod +x crictl
$SUDO mv crictl /usr/local/bin/
rm crictl.tar.gz
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
$SUDO mv minikube /usr/local/bin/
fi