#3782 -- Make Ansible update/install scripts use the same apt calls.
This commit is contained in:
parent
4eeb725436
commit
3018c01eab
37
install.sh
37
install.sh
|
@ -1,38 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do
|
||||
case $1 in
|
||||
--dev)
|
||||
APP_ENV="development"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
case $1 in
|
||||
--dev)
|
||||
APP_ENV="development"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
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
|
||||
echo "Ansible installation is only supported on Ubuntu distributions."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' ansible | grep "install ok installed")
|
||||
echo "Checking for Ansible: $PKG_OK"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y software-properties-common
|
||||
|
||||
if [[ "" == "$PKG_OK" ]]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y software-properties-common
|
||||
if [[ $DISTRIB_CODENAME == "focal" ]]; then
|
||||
sudo apt-get install -q -y ansible python3-pip python3-mysqldb
|
||||
else
|
||||
sudo add-apt-repository -y ppa:ansible/ansible
|
||||
sudo apt-get update
|
||||
|
||||
if [[ $DISTRIB_CODENAME == "focal" ]]; then
|
||||
sudo apt-get install -q -y ansible python3-pip python3-mysqldb
|
||||
else
|
||||
sudo add-apt-repository -y ppa:ansible/ansible
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get install -q -y python2.7 python-pip python-mysqldb ansible
|
||||
fi
|
||||
sudo apt-get install -q -y python2.7 python-pip python-mysqldb ansible
|
||||
fi
|
||||
|
||||
APP_ENV="${APP_ENV:-production}"
|
||||
|
|
33
update.sh
33
update.sh
|
@ -14,23 +14,28 @@ while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do
|
|||
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
|
||||
|
||||
if [[ $DISTRIB_CODENAME == "focal" ]]; then
|
||||
sudo apt-get install -q -y ansible python3-pip python3-mysqldb
|
||||
else
|
||||
sudo add-apt-repository -y ppa:ansible/ansible
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get install -q -y python2.7 python-pip python-mysqldb ansible
|
||||
fi
|
||||
|
||||
APP_ENV="${APP_ENV:-production}"
|
||||
UPDATE_REVISION="${UPDATE_REVISION:-60}"
|
||||
|
||||
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' ansible | grep "install ok installed")
|
||||
echo "Checking for Ansible: $PKG_OK"
|
||||
|
||||
if [[ "" == "$PKG_OK" ]]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y software-properties-common
|
||||
sudo apt-add-repository ppa:ansible/ansible
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y ansible python-mysqldb
|
||||
else
|
||||
sudo apt-get update
|
||||
sudo apt-get install -q -y ansible python-mysqldb
|
||||
fi
|
||||
|
||||
echo "Updating AzuraCast (Environment: $APP_ENV, Update revision: $UPDATE_REVISION)"
|
||||
|
||||
if [[ ${APP_ENV} == "production" ]]; then
|
||||
|
|
Loading…
Reference in New Issue