user-entrypoint.sh (1074B)
1 #! /bin/sh 2 3 cd /var/www/pk 4 5 # Check if parameters are present 6 if [ ! -f app/config/parameters.php ]; then 7 echo 'No configuration was found yet. A defult configuration was generated.' >&2 8 echo 'Please visit the setup page if you encounter issues.' >&2 9 10 # Remove any db related config from the dist file 11 grep -v "setParameter('database_" app/config/parameters.php.dist > app/config/parameters.php 12 cat /parameters.defaults.php >> app/config/parameters.php 13 fi 14 15 # Run composer 16 composer install 17 18 # Simulare a setup run 19 if [ "x$PARTKEEPR_FORCE_UPDATE" = "xyes" ]; then 20 21 # Clears the production cache 22 php app/console cache:clear --env=prod 23 24 # Executes the database migrations 25 php app/console doctrine:migrations:migrate --no-interaction 26 27 # Updates the database schema 28 php app/console doctrine:schema:update --force 29 30 # Builds all required files and warms up the cache 31 ./vendor/bin/phing 32 33 fi 34 35 # Runs all crons 36 php app/console partkeepr:cron:run 37 38 # Add phpinfo() file if requested 39 if [ -n "$ADD_PHPINFO_FILE" ]; then 40 cp /var/www/html/phpinfo.php /var/www/pk/web 41 fi