abra/deploy/install.abra.autonomic.zone/installer

36 lines
877 B
Plaintext
Raw Normal View History

2020-09-22 11:37:33 +00:00
#!/bin/bash
2021-04-07 18:54:16 +00:00
ABRA_VERSION="0.7.0"
GIT_URL="https://git.autonomic.zone/coop-cloud/abra"
ABRA_SRC="$GIT_URL/raw/tag/$ABRA_VERSION/abra"
2021-04-07 18:57:30 +00:00
ABRA_DIR="${ABRA_DIR:+$HOME/.abra/}"
2020-09-22 11:37:33 +00:00
function install_abra_release {
2020-09-22 11:37:33 +00:00
mkdir -p "$HOME/.local/bin"
2021-01-01 21:44:21 +00:00
curl "$ABRA_SRC" > "$HOME/.local/bin/abra"
2020-09-22 11:37:33 +00:00
chmod +x "$HOME/.local/bin/abra"
2021-03-01 10:38:15 +00:00
echo "abra installed to $HOME/.local/bin/abra"
2020-09-22 11:37:33 +00:00
}
function install_abra_dev {
2021-04-07 12:33:17 +00:00
mkdir -p "$ABRA_DIR/"
if [[ ! -d "$ABRA_DIR/src" ]]; then
git clone "$GIT_URL" "$ABRA_DIR/src"
fi
2021-04-07 12:33:17 +00:00
(cd "$ABRA_DIR/src" && git pull origin main && cd - || exit)
mkdir -p "$HOME/.local/bin"
2021-04-07 12:33:17 +00: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 11:37:33 +00:00
function run_installation {
if [ "$1" = "--dev" ]; then
install_abra_dev
else
install_abra_release
fi
2020-09-22 11:37:33 +00:00
}
run_installation "$@"
2020-09-22 11:37:33 +00:00
exit 0