feat(bin): Add scripts to update cloudflared and Minikube
Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
parent
6604004ae6
commit
7658b34e56
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Updater script for Cloudflared
|
||||||
|
# Basically it's an script for installing Cloudflared
|
||||||
|
# during image build btw
|
||||||
|
|
||||||
|
# pull the builder's arch first
|
||||||
|
ARCH_TO_USE="$IMAGE_ARCH"
|
||||||
|
|
||||||
|
if [[ $ARCH_TO_USE == "" ]]; then
|
||||||
|
ARCH_TO_USE="$(uname -p)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f /usr/local/bin/cloudflared ]]; then
|
||||||
|
echo "[cloudlfared-updater] Removing old version..."
|
||||||
|
sudo rm -fv /usr/local/bin/cloudflared
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLOUDFLARED_VERSION=$(curl --silent "https://api.github.com/repos/cloudflare/cloudflared/releases/latest" | jq -r .tag_name)
|
||||||
|
|
||||||
|
echo "[cloudflared-updater] Installing latest version of Argo Tunnel agent.."
|
||||||
|
if [[ $ARCH_TO_USE == "aarch64" ]]; then
|
||||||
|
sudo wget https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-arm64 -O /usr/local/bin/cloudflared
|
||||||
|
else
|
||||||
|
sudo wget https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-amd64 -O /usr/local/bin/cloudflared
|
||||||
|
fi
|
||||||
|
sudo chmod +x /usr/local/bin/cloudflared
|
||||||
|
|
||||||
|
if [[ $? == "0" ]]; then
|
||||||
|
echo "[cloudflared-installer] Successfully updated!"
|
||||||
|
else
|
||||||
|
echo "[cloudlfared-installer] Installer failed, exiting..."
|
||||||
|
exit $?
|
||||||
|
fi
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
install() {
|
||||||
|
if [ ! -f "/usr/local/bin/minikube"]; then
|
||||||
|
rm -v /usr/local/bin/minikube
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 -O /usr/local/bin/minikube
|
||||||
|
sudo chmod +x /usr/local/bin/minikube
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install virtualbox and the extension packs
|
||||||
|
sudo apt install virtualbox virtualbox-ext-pack
|
||||||
|
|
||||||
|
# then download the latest Minukube version
|
||||||
|
install
|
||||||
|
|
||||||
|
# finally, check if it's success.
|
||||||
|
minikube version
|
Loading…
Reference in New Issue