Mirror of github.com/ppy/osu-web, in case ppy decides to take the original down for some reason.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.sh 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. set -u
  3. set -e
  4. # The user when provisioning is different than the user running actual php workers (in production).
  5. if [ -z "${OSU_SKIP_CACHE_PERMISSION_OVERRIDE:-}" ]; then
  6. # Don't fail if permissions don't get set on all files.
  7. chmod -R 777 storage bootstrap/cache || true
  8. fi
  9. if [ -f composer.phar ]; then
  10. php composer.phar self-update
  11. else
  12. curl -sL https://getcomposer.org/installer > composer-installer
  13. php composer-installer
  14. fi
  15. # dummy user, no privilege github token to avoid github api limit
  16. php composer.phar config -g github-oauth.github.com 98cbc568911ef1e060a3a31623f2c80c1786d5ff
  17. rm -f bootstrap/cache/*.php bootstrap/cache/*.json
  18. if [ -z "${OSU_INSTALL_DEV:-}" ]; then
  19. php composer.phar install --no-dev
  20. else
  21. php composer.phar install
  22. fi
  23. php artisan view:clear
  24. # e.g. OSU_SKIP_DB_MIGRATION=1 ./build.sh to bypass running migrations
  25. if [ -z "${OSU_SKIP_DB_MIGRATION:-}" ]; then
  26. php artisan migrate --force
  27. else
  28. echo "OSU_SKIP_DB_MIGRATION set, skipping DB migration."
  29. fi
  30. php artisan passport:keys
  31. # e.g. OSU_SKIP_ASSET_BUILD=1 ./build.sh to bypass building javascript assets
  32. if [ -z "${OSU_SKIP_ASSET_BUILD:-}" ]; then
  33. if [ ! -d node_modules ]; then
  34. mkdir -p ~/node_modules
  35. ln -snf ~/node_modules node_modules
  36. fi
  37. php artisan laroute:generate
  38. command -v yarn || npm install -g yarn
  39. yarn
  40. yarn run generate-localizations
  41. yarn run production
  42. else
  43. echo "OSU_SKIP_ASSET_BUILD set, skipping javascript asset build."
  44. fi