2016-10-02 03:50:40 +05:30
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
cd /var/www/html
|
|
|
|
|
|
2016-10-03 04:31:21 +05:30
|
|
|
|
if [ "$1" = "bash" ] || [ "$1" = "composer" ]
|
2016-10-02 03:50:40 +05:30
|
|
|
|
then
|
|
|
|
|
exec "$@"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Переносим vendor, если его нету или он изменился (или затёрся силами volume)
|
|
|
|
|
if ! cmp -s ./../vendor/autoload.php ./vendor/autoload.php
|
|
|
|
|
then
|
|
|
|
|
echo "vendor have diffs..."
|
|
|
|
|
echo "removing exists 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 exists dist"
|
|
|
|
|
rm -rf ./frontend/dist
|
|
|
|
|
echo "copying new one"
|
|
|
|
|
cp -r ./../dist ./frontend/dist
|
|
|
|
|
fi
|
|
|
|
|
|
2016-10-03 04:31:21 +05:30
|
|
|
|
if [ "$YII_ENV" != "test" ]
|
|
|
|
|
then
|
|
|
|
|
wait-for-it db:3306 -- "php /var/www/html/yii migrate/up --interactive=0"
|
|
|
|
|
else
|
|
|
|
|
wait-for-it testdb:3306 -- "php /var/www/html/tests/codeception/bin/yii migrate/up --interactive=0"
|
|
|
|
|
fi
|
2016-10-02 03:50:40 +05:30
|
|
|
|
|
|
|
|
|
exec "$@"
|