-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-tools.sh
More file actions
executable file
·207 lines (177 loc) · 6.27 KB
/
install-tools.sh
File metadata and controls
executable file
·207 lines (177 loc) · 6.27 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#!/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 dnf 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 dnf 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 dnf 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 dnf install -y dnf-plugins
sudo dnf config-manager addrepo --from-repofile=https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf 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
}
function install_kaggle {
pip install kaggle --upgrade
}
function install_glab {
# Get the latest release version from GitLab API
latest_version=$(curl -s "https://gitlab.com/api/v4/projects/34675721/releases" | grep -o '"tag_name":"[^"]*' | head -1 | cut -d'"' -f4)
if [ -z "$latest_version" ]; then
echo "Failed to get latest glab version"
return 1
fi
# Remove 'v' prefix for the filename
version_number=$(echo $latest_version | cut -c 2-)
rpm_url="https://gitlab.com/gitlab-org/cli/-/releases/$latest_version/downloads/glab_${version_number}_linux_amd64.rpm"
echo "Installing glab $latest_version from $rpm_url"
sudo dnf install -y "$rpm_url"
}
function install_upterm {
git clone https://github.com/owenthereal/upterm && cd upterm
latest_tag=$(gh release list | grep -m1 Latest | awk '{print $4}')
sudo dnf install -y https://github.com/owenthereal/upterm/releases/download/$latest_tag/upterm_linux_amd64.rpm
cd .. && rm -rf upterm
}
function build_claude_container {
git clone https://github.com/EmilienM/claude-code && cd claude-code
podman build -f .devcontainer/Dockerfile -t claude-code .devcontainer
cd .. && rm -rf claude-code
}
#install_hcp
install_upterm
install_code_insiders
install_glab
#install_oc_client
#install_oc_install
install_bw
install_clusterctl
install_kaggle
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
build_claude_container
claude update
chmod +x $TMP_DIR/out/*
cp $TMP_DIR/out/* ~/.local/bin