gnu-social/docker/social/install.sh

41 lines
910 B
Bash
Raw Normal View History

#!/bin/sh
case "${DBMS}" in
'postgres')
PGPASSWORD="${POSTGRES_PASSWORD}" psql -ltq -Upostgres -hdb | \
2020-05-16 13:37:06 +01:00
cut -d '|' -f1 | grep -Fwq "${SOCIAL_DB}"
DB_EXISTS=$?
;;
'mariadb')
2020-05-16 13:37:06 +01:00
mysqlcheck -cqs -uroot -p"${MYSQL_ROOT_PASSWORD}" -hdb social 2> /dev/null
DB_EXISTS=$?
exit 1
;;
*)
echo "Unknown DBMS"
exit 1
esac
2020-05-16 13:37:06 +01:00
if [ ${DB_EXISTS} -ne 0 ]; then
2020-05-16 13:37:06 +01:00
echo "Installing GNU social"
echo "Installing composer dependencies"
2020-05-16 13:37:06 +01:00
cd /var/www/social || exit 1
composer -n install
chmod g+w -R .
chown -R :www-data .
php bin/console doctrine:database:create || exit 1
php bin/console doctrine:schema:create || exit 1
php bin/console app:populate_initial_values || exit 1
./bin/install_plugins.sh
echo "GNU social is installed"
2020-05-16 13:37:06 +01:00
else
echo "GNU social is already installed"
fi