This repository has been archived on 2021-07-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
abra/deploy/install.abra.coopcloud.tech/installer
T

36 lines
876 B
Bash
Raw Normal View History

2020-09-22 13:37:33 +02:00
#!/bin/bash
2021-06-10 11:43:00 +02:00
ABRA_VERSION="9.0.0"
2021-03-14 14:39:11 +02:00
GIT_URL="https://git.autonomic.zone/coop-cloud/abra"
ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra"
2021-06-05 08:51:02 +02:00
ABRA_DIR="${ABRA_DIR:-$HOME/.abra}"
2020-09-22 13:37:33 +02:00
2021-03-14 14:39:11 +02:00
function install_abra_release {
2020-09-22 13:37:33 +02:00
mkdir -p "$HOME/.local/bin"
2021-01-01 22:44:21 +01:00
curl "$ABRA_SRC" > "$HOME/.local/bin/abra"
2020-09-22 13:37:33 +02:00
chmod +x "$HOME/.local/bin/abra"
2021-03-01 11:38:15 +01:00
echo "abra installed to $HOME/.local/bin/abra"
2020-09-22 13:37:33 +02:00
}
2021-03-14 14:39:11 +02:00
function install_abra_dev {
2021-04-07 14:33:17 +02:00
mkdir -p "$ABRA_DIR/"
if [[ ! -d "$ABRA_DIR/src" ]]; then
git clone "$GIT_URL" "$ABRA_DIR/src"
fi
2021-04-07 14:33:17 +02:00
(cd "$ABRA_DIR/src" && git pull origin main && cd - || exit)
2021-03-14 14:39:11 +02:00
mkdir -p "$HOME/.local/bin"
2021-04-07 14:33:17 +02:00
ln -sf "$ABRA_DIR/src/abra" "$HOME/.local/bin/abra"
echo "abra installed to $HOME/.local/bin/abra (development bleeding edge)"
2020-09-22 13:37:33 +02:00
}
2021-03-14 14:39:11 +02:00
function run_installation {
if [ "$1" = "--dev" ]; then
install_abra_dev
else
install_abra_release
fi
}
run_installation "$@"
2020-09-22 13:37:33 +02:00
exit 0