Skip to content

Commit

Permalink
Merge pull request ezsystems#466 from ezsystems/464_master_merge
Browse files Browse the repository at this point in the history
464 master merge for testing and review
  • Loading branch information
andrerom authored Oct 3, 2019
2 parents 4ca5b63 + 2e7787f commit 2c7d70e
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions doc/docker/install_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@
# Dumping autoload using --optimize-autoloader to keep performenace on a usable level, not needed on linux host.
# Second chown line: For dev and behat tests we give a bit extra rights, never do this for prod.

for i in $(seq 1 3); do composer install --no-progress --no-interaction --prefer-dist --no-suggest --optimize-autoloader && s=0 && break || s=$? && sleep 1; done; (exit $s);
mkdir -p public/var;
for i in $(seq 1 3); do
composer install --no-progress --no-interaction --prefer-dist --no-suggest --optimize-autoloader && s=0 && break || s=$? && sleep 1
done
if [ "$s" != "0" ]; then
echo "ERROR : composer install failed, exit code : $s"
exit $s
fi
mkdir -p public/var

if [ "${INSTALL_DATABASE}" == "1" ]; then
php /scripts/wait_for_db.php;
composer ezplatform-install;
if [ "$APP_CMD" != '' ]; then echo '> Executing' "$APP_CMD"; php bin/console $APP_CMD; fi;
echo 'Dumping database into doc/docker/entrypoint/mysql/2_dump.sql for use by mysql on startup.';
mysqldump -u $DATABASE_USER --password=$DATABASE_PASSWORD -h $DATABASE_HOST --add-drop-table --extended-insert --protocol=tcp $DATABASE_NAME > doc/docker/entrypoint/mysql/2_dump.sql;
fi;
php /scripts/wait_for_db.php
composer ezplatform-install
if [ "$APP_CMD" != '' ]; then
echo '> Executing' "$APP_CMD"
php bin/console $APP_CMD
fi
echo 'Dumping database into doc/docker/entrypoint/mysql/2_dump.sql for use by mysql on startup.'
mysqldump -u $DATABASE_USER --password=$DATABASE_PASSWORD -h $DATABASE_HOST --add-drop-table --extended-insert --protocol=tcp $DATABASE_NAME > doc/docker/entrypoint/mysql/2_dump.sql
fi

rm -Rf var/log/* var/cache/*/*;
chown -R www-data:www-data var/cache var/log public/var;
find var/cache var/log public/var -type d -print0 | xargs -0 chmod -R 775;
find var/cache var/log public/var -type f -print0 | xargs -0 chmod -R 664;
chown -R www-data:www-data config src;
rm -Rf var/log/* var/cache/*/*
chown -R www-data:www-data var/cache var/log public/var
find var/cache var/log public/var -type d -print0 | xargs -0 chmod -R 775
find var/cache var/log public/var -type f -print0 | xargs -0 chmod -R 664
chown -R www-data:www-data config src

0 comments on commit 2c7d70e

Please sign in to comment.