AzuraCast/install.sh

35 lines
849 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
2020-06-09 10:10:07 +00:00
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do
case $1 in
--dev)
APP_ENV="development"
2020-06-09 10:10:07 +00:00
shift
;;
esac
shift
2020-06-09 10:10:07 +00:00
done
if [[ "$1" == '--' ]]; then shift; fi
. /etc/lsb-release
if [[ $DISTRIB_ID != "Ubuntu" ]]; then
echo "Ansible installation is only supported on Ubuntu distributions."
exit 0
fi
sudo apt-get update
sudo apt-get install -q -y software-properties-common
2022-10-22 11:23:57 +00:00
if [[ $DISTRIB_CODENAME == "focal" || $DISTRIB_CODENAME == "jammy" ]]; then
sudo apt-get install -q -y ansible python3-pip python3-mysqldb
else
2022-10-22 11:23:57 +00:00
echo "Ansible installation is only supported on Ubuntu Focal (20.04) or Jammy (22.04)."
exit 0
fi
APP_ENV="${APP_ENV:-production}"
echo "Installing AzuraCast (Environment: $APP_ENV)"
2020-06-09 10:10:07 +00:00
ansible-playbook util/ansible/deploy.yml --inventory=util/ansible/hosts --extra-vars "app_env=$APP_ENV"