setup.sh 1.0 KB

12345678910111213141516171819202122
  1. #!/bin/bash
  2. fw_depends mysql php7 nginx
  3. sed -i 's|localhost|'"${DBHOST}"'|g' deploy/nginx.conf
  4. sed -i 's|root .*/FrameworkBenchmarks/php-symfony| root '"${TROOT}"'|g' deploy/nginx.conf
  5. sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
  6. php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  7. php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  8. php composer-setup.php
  9. php -r "unlink('composer-setup.php');"
  10. export APP_ENV=prod
  11. php composer.phar install --no-dev --no-interaction --no-progress --optimize-autoloader --classmap-authoritative
  12. php bin/console cache:clear --env=prod --no-debug --no-warmup
  13. php bin/console cache:warmup --env=prod --no-debug
  14. php-fpm --fpm-config $FWROOT/toolset/setup/linux/languages/php/php-fpm.conf -g $TROOT/deploy/php-fpm.pid
  15. nginx -c $TROOT/deploy/nginx.conf