post-create.sh 668 B

1234567891011121314151617181920212223242526
  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. yarn install --immutable
  11. # [re]create, migrate, and seed the test database
  12. RAILS_ENV=test ./bin/rails db:setup
  13. # [re]create, migrate, and seed the development database
  14. RAILS_ENV=development ./bin/rails db:setup
  15. # Precompile assets for development
  16. RAILS_ENV=development ./bin/rails assets:precompile
  17. # Precompile assets for test
  18. RAILS_ENV=test NODE_ENV=tests ./bin/rails assets:precompile