post-create.sh 670 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. set -e # Fail the whole script on first error
  3. # Fetch Ruby gem dependencies
  4. bundle config path 'vendor/bundle'
  5. bundle config with 'development test'
  6. bundle install
  7. # Make Gemfile.lock pristine again
  8. git checkout -- Gemfile.lock
  9. # Fetch Javascript dependencies
  10. corepack prepare
  11. yarn install --immutable
  12. # [re]create, migrate, and seed the test database
  13. RAILS_ENV=test ./bin/rails db:setup
  14. # [re]create, migrate, and seed the development database
  15. RAILS_ENV=development ./bin/rails db:setup
  16. # Precompile assets for development
  17. RAILS_ENV=development ./bin/rails assets:precompile
  18. # Precompile assets for test
  19. RAILS_ENV=test ./bin/rails assets:precompile