From ee5203a03dc722eef695817d88bb5f6842ba5655 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Fri, 22 Dec 2023 17:47:00 +0300 Subject: [PATCH] Add Velero https://velero.io/docs/v1.12/basic-install/#option-2-github-release --- README.md | 2 +- groups/shell/kubernetes | 1 - groups/shell/stackspin | 3 +++ handlers/apt/install_deb | 11 ++++++++--- packages/velero/aur | 1 + packages/velero/binary | 11 +++++++++++ 6 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 groups/shell/stackspin create mode 100644 packages/velero/aur create mode 100755 packages/velero/binary diff --git a/README.md b/README.md index a93142a..a4a53e9 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ The classic way I get this onto a Linux server: cd /opt sudo chown --from=:root :sudo . && sudo chmod g+w . sudo apt install git -git clone https://github.com/xeruf/instalee +git clone https://github.com/xeruf/instalee || git -C instalee pull instalee/instalee shell/basics ``` diff --git a/groups/shell/kubernetes b/groups/shell/kubernetes index f24cea8..37fccfc 100644 --- a/groups/shell/kubernetes +++ b/groups/shell/kubernetes @@ -1,5 +1,4 @@ kubectl helm k9s -fluxctl kubectx diff --git a/groups/shell/stackspin b/groups/shell/stackspin new file mode 100644 index 0000000..69a493d --- /dev/null +++ b/groups/shell/stackspin @@ -0,0 +1,3 @@ +shell/kubernetes +fluxctl +velero diff --git a/handlers/apt/install_deb b/handlers/apt/install_deb index 49a1152..8d10250 100755 --- a/handlers/apt/install_deb +++ b/handlers/apt/install_deb @@ -6,9 +6,14 @@ case "$1" in (http*) wget --no-verbose -O "$loc" "$@";; (*.deb) loc="$1";; (git*) domain="$1"; shift - result=$(curl -s "https://api.$domain/repos/$1/$2/releases/latest" | grep -o "http.*${3:-deb}" | awk '{ print length(), $0}' | sort -n | cut -d' ' -f2-) - "$0" $(echo "$result" | command grep amd64 | head -1 || echo "$result") - exit $?;; + arch=$(uname -m) + case "$arch" in + (x86_64) arch=amd64;; + (aarch64) arch=arm64;; + esac + result=$(curl -s "https://api.$domain/repos/$1/$2/releases/latest" | grep -o "http.*${3:-deb}" | awk '{ print length(), $0}' | sort -n | cut -d' ' -f2-) + "$0" $(echo "$result" | grep $arch | head -1 || echo "$result") + exit $?;; esac sudo dpkg -i "$loc" sudo apt-get -f install diff --git a/packages/velero/aur b/packages/velero/aur new file mode 100644 index 0000000..0a6f0e1 --- /dev/null +++ b/packages/velero/aur @@ -0,0 +1 @@ +velero-bin diff --git a/packages/velero/binary b/packages/velero/binary new file mode 100755 index 0000000..32b2846 --- /dev/null +++ b/packages/velero/binary @@ -0,0 +1,11 @@ +#!/bin/sh +arch=$(uname -m) +case "$arch" in + (x86_64) arch=amd64;; + (aarch64) arch=arm64;; +esac + +result=$(curl https://api.github.com/repos/vmware-tanzu/velero/releases/latest | grep -o "http.*.tar.gz" | awk '{ print length(), $0}' | sort -n | cut -d' ' -f2- | grep linux-$arch | head -1) +wget "$result" +tar -xvf $(basename "$result") +echo $(basename "$result")/velero