-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcloud.bash
executable file
·84 lines (67 loc) · 2.83 KB
/
cloud.bash
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
#!/bin/bash
if ! command -v gcloud &> /dev/null; then
# https://cloud.google.com/sdk/docs/install#deb
sudo apt update
sudo apt install apt-transport-https ca-certificates gnupg curl
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt update && sudo apt install google-cloud-cli -y
gcloud init
else
echo "gcloud is already installed."
fi
if ! command -v aws &> /dev/null; then
# https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm awscliv2.zip
rm -rf aws
else
echo "aws is already installed."
fi
if ! command -v eksctl &> /dev/null; then
# https://eksctl.io/installation/
ARCH=amd64
PLATFORM=$(uname -s)_$ARCH
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
# (Optional) Verify checksum
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
sudo mv /tmp/eksctl /usr/local/bin
else
echo "eksctl is already installed."
fi
if ! command -v az &> /dev/null; then
# https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
else
echo "az is already installed."
fi
if ! command -v doctl &> /dev/null; then
# https://docs.digitalocean.com/reference/doctl/how-to/install/
wget https://github.com/digitalocean/doctl/releases/download/v1.120.1/doctl-1.120.1-linux-amd64.tar.gz
tar xf doctl-1.120.1-linux-amd64.tar.gz
sudo mv doctl /usr/local/bin
rm doctl-1.120.1-linux-amd64.tar.gz
else
echo "doctl is already installed."
fi
if ! command -v s3cmd &> /dev/null; then
# https://www.linode.com/docs/products/storage/object-storage/guides/s3cmd/#configuring-s3cmd
sudo apt install s3cmd
s3cmd --configure
# S3 Endpoint: us-east-1.linodeobjects.com
# DNS-style bucket+hostname: %(bucket)s.us-east-1.linodeobjects.com
# Test access with supplied credentials? n
else
echo "s3cmd is already installed."
fi
if ! command -v clusterctl &> /dev/null; then
# https://cluster-api.sigs.k8s.io/user/quick-start#install-clusterctl
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.4/clusterctl-linux-amd64 -o clusterctl
sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl
rm clusterctl
else
echo "clusterctl is already installed."
fi