accounts/docker/php/bootstrap.sh
ErickSkrauch d2b7f28db6 Базовый image обновлён до accounts-php:1.5.0
Логика bootstrap.sh теперь перенесена в этот репозиторий
Добавлен вызов команды для генерации структуры RBAC
2017-09-21 16:23:05 +03:00

39 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
if [ "$YII_ENV" = "test" ]
then
YII_EXEC="/var/www/html/tests/codeception/bin/yii"
else
YII_EXEC="/var/www/html/yii"
fi
if ! cmp -s ./../vendor/autoload.php ./vendor/autoload.php
then
echo "Vendor have diffs"
echo "Removing not bundled vendor..."
rm -rf ./vendor
echo "Copying new one..."
cp -r ./../vendor ./vendor
fi
# Переносим dist, если его нету или он изменился (или затёрся силами volume)
if ! cmp -s ./../dist/index.html ./frontend/dist/index.html
then
echo "Frontend dist have diffs"
echo "Removing not bundled dist..."
rm -rf ./frontend/dist
echo "Copying new one..."
cp -r ./../dist ./frontend/dist
fi
# Генерируем правила RBAC
echo "Generating RBAC rules"
php $YII_EXEC rbac/generate
if [ "$YII_ENV" != "test" ]
then
wait-for-it "${DB_HOST:-db}:3306" -s -t 0 -- "php $YII_EXEC migrate/up --interactive=0"
else
wait-for-it "${DB_HOST:-testdb}:3306" -s -t 0 -- "php $YII_EXEC migrate/up --interactive=0"
fi