abra/scripts/installer/installer

54 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-09-07 11:01:22 +00:00
#!/usr/bin/env bash
2021-10-12 09:19:26 +00:00
ABRA_VERSION="0.1.8-alpha"
2021-09-07 11:01:22 +00:00
ABRA_RELEASE_URL="https://git.coopcloud.tech/api/v1/repos/coop-cloud/abra/releases/tags/$ABRA_VERSION"
function show_banner {
echo ""
echo " ____ ____ _ _ "
echo " / ___|___ ___ _ __ / ___| | ___ _ _ __| |"
echo " | | / _ \ _____ / _ \| '_ \ | | | |/ _ \| | | |/ _' |"
echo " | |__| (_) |_____| (_) | |_) | | |___| | (_) | |_| | (_| |"
echo " \____\___/ \___/| .__/ \____|_|\___/ \__,_|\__,_|"
echo " |_|"
echo ""
echo ""
echo " === Public interest infrastructure === "
echo ""
echo ""
}
function install_abra_release {
mkdir -p "$HOME/.local/bin"
if ! type "curl" > /dev/null 2>&1; then
echo "'curl' is not installed, cannot proceed..."
echo "perhaps try installing manually via the releases URL?"
echo "https://git.coopcloud.tech/coop-cloud/abra/releases"
exit 1
fi
if ! type "curl" > /dev/null 2>&1; then
error "'python3' is not installed, cannot proceed..."
echo "perhaps try installing manually via the releases URL?"
echo "https://git.coopcloud.tech/coop-cloud/abra/releases"
fi
# FIXME: support different architectures
release_url=$(curl -s $ABRA_RELEASE_URL | sed -rn 's/.*"assets":\[\{[^}]*"name":"abra.*linux_x86_64"[^}]*"browser_download_url":"([^"]*)".*\].*/\1/p' -)
2021-09-07 11:01:22 +00:00
echo "downloading $ABRA_VERSION x86_64 binary release for abra..."
2021-09-07 11:01:22 +00:00
curl --progress-bar "$release_url" --output "$HOME/.local/bin/abra"
chmod +x "$HOME/.local/bin/abra"
echo "abra installed to $HOME/.local/bin/abra"
}
function run_installation {
show_banner
install_abra_release
}
run_installation "$@"
exit 0