-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-tools.sh
executable file
·168 lines (145 loc) · 5.06 KB
/
install-tools.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
trap "rm -rf $TMP_DIR" EXIT
TMP_DIR=$(mktemp -d)
echo "TMP_DIR: $TMP_DIR"
cd $TMP_DIR
mkdir out
function install_oc_install {
mkdir oc_install && cd oc_install
wget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/openshift-install-linux.tar.gz
tar xf openshift-install-linux.tar.gz
mv openshift-install ../out/openshift-install-latest
cd .. && rm -rf oc_install
}
function install_oc_client {
mkdir oc && cd oc
wget https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/openshift-client-linux.tar.gz
tar xf openshift-client-linux.tar.gz
mv oc ../out
cd .. && rm -rf oc
}
function install_bw {
git clone https://github.com/bitwarden/clients && cd clients
latest_tag=$(gh release list | grep -m1 CLI | awk '{print $3}')
fileversion=$(echo $latest_tag | cut -c 6-)
wget https://github.com/bitwarden/clients/releases/download/$latest_tag/bw-linux-$fileversion.zip
unzip bw-linux-$fileversion.zip
mv bw ../out
cd .. && rm -rf clients
}
function install_clusterctl {
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/latest/download/clusterctl-linux-amd64 -o out/clusterctl
}
function install_k9s {
sudo dnf5 install -y https://github.com/derailed/k9s/releases/latest/download/k9s_linux_amd64.rpm
}
function install_kustomize {
git clone https://github.com/kubernetes-sigs/kustomize && cd kustomize
latest_tag=$(gh release list | grep -m1 kustomize | awk '{print $3}')
fileversion=$(echo $latest_tag | cut -c 11-)
rm -rf kustomize
wget https://github.com/kubernetes-sigs/kustomize/releases/download/$latest_tag/kustomize_${fileversion}_linux_amd64.tar.gz
tar xf kustomize_${fileversion}_linux_amd64.tar.gz
mv kustomize ../out
cd .. && rm -rf kustomize
}
function install_rclone {
git clone https://github.com/rclone/rclone && cd rclone
latest_tag=$(gh release list | grep -m1 Latest | awk '{print $2}')
sudo dnf5 install -y https://github.com/rclone/rclone/releases/download/$latest_tag/rclone-$latest_tag-linux-amd64.rpm
cd .. && rm -rf rclone
}
function install_kuttl {
git clone https://github.com/kudobuilder/kuttl && cd kuttl
latest_tag=$(gh release list | grep -m1 Latest | awk '{print $3}')
fileversion=$(echo $latest_tag | cut -c 2-)
wget https://github.com/kudobuilder/kuttl/releases/download/$latest_tag/kubectl-kuttl_${fileversion}_linux_x86_64
mv kubectl-kuttl_${fileversion}_linux_x86_64 ../out/kuttl
cd .. && rm -rf kuttl
}
function install_tilt {
git clone https://github.com/tilt-dev/tilt && cd tilt
latest_tag=$(gh release list | grep -m1 Latest | awk '{print $3}')
fileversion=$(echo $latest_tag | cut -c 2-)
wget https://github.com/tilt-dev/tilt/releases/download/$latest_tag/tilt.$fileversion.linux.x86_64.tar.gz
tar xf tilt.$fileversion.linux.x86_64.tar.gz
mv tilt ../out
cd .. && rm -rf tilt
}
function install_kubecolor {
git clone https://github.com/kubecolor/kubecolor && cd kubecolor
latest_tag=$(gh release list | grep -m1 Latest | awk '{print $3}')
fileversion=$(echo $latest_tag | cut -c 2-)
wget https://github.com/kubecolor/kubecolor/releases/download/$latest_tag/kubecolor_${fileversion}_linux_amd64.tar.gz
tar xf kubecolor_${fileversion}_linux_amd64.tar.gz
mv kubecolor ../out
cd .. && rm -rf kubecolor
}
function install_kor {
git clone https://github.com/yonahd/kor && cd kor
latest_tag=$(gh release list | grep -m1 Latest | awk '{print $3}')
wget https://github.com/yonahd/kor/releases/download/$latest_tag/kor_Linux_x86_64.tar.gz
tar xf kor_Linux_x86_64.tar.gz
mv kor ../out
cd .. && rm -rf kor
}
function install_hwatch {
sudo dnf5 install -y cargo
cargo install hwatch
}
function install_kind {
go install sigs.k8s.io/kind@latest
}
function install_envsubst {
go install github.com/drone/envsubst@latest
}
function install_code_insiders {
sudo dnf install -y "https://code.visualstudio.com/sha/download?build=insider&os=linux-rpm-x64"
}
function install_ctlptl {
go install github.com/tilt-dev/ctlptl/cmd/ctlptl@latest
}
function install_gh_extensions {
sudo dnf5 install -y dnf5-plugins
sudo dnf5 config-manager addrepo --from-repofile=https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf5 install -y gh --repo gh-cli
gh extension install github/gh-copilot || true
gh extension upgrade gh-copilot
}
function install_hcp {
podman run --rm --privileged -it -v \
$PWD:/output docker.io/library/golang:1.23 /bin/bash -c \
'git clone https://github.com/openshift/hypershift.git && \
cd hypershift/ && \
make hypershift product-cli && \
mv bin/hypershift /output/hypershift && \
mv bin/hcp /output/hcp'
mv hcp hypershift out
}
function install_omc {
mkdir omc && cd omc
curl -sL https://github.com/gmeghnag/omc/releases/latest/download/omc_Linux_x86_64.tar.gz | tar xzf - omc
mv omc ../out
cd .. && rm -rf omc
}
install_hcp
install_oc_client
install_oc_install
install_bw
install_clusterctl
install_k9s
install_omc
install_kustomize
install_tilt
install_kuttl
install_rclone
install_hwatch
install_kind
install_envsubst
install_ctlptl
install_kubecolor
install_kor
install_gh_extensions
install_code_insiders
chmod +x $TMP_DIR/out/*
cp $TMP_DIR/out/* ~/.local/bin