Script to make it easier to test Safari on BrowserStack

pull/9662/head
Henriette Darge 3 years ago
parent 35718c79b9
commit 52503ab5db
  1. 21
      bin/safari_browser_stack
  2. 4
      bin/setup_dev
  3. 2
      config/environments/development.rb

@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Sets environment variable OPENPROJECT_DISABLE_DEV_ASSET_PROXY and builds assets manifest
# Useful for testing Safari on browser stack
yell() { echo -e "$0: $*" >&2; }
die() { yell "$*"; exit 1; }
try() { eval "$@" || die "\n\nFailed to run '$*', check log/safari_browser_stack.log for more information."; }
echo "Building new assets"
try 'export OPENPROJECT_DISABLE_DEV_ASSET_PROXY="true"'
try 'bundle exec rake assets:rebuild_manifest >> log/safari_browser_stack.log'
echo "---------------------------------------"
echo "Done. Now run the following services"
echo '- Rails server `RAILS_ENV=development OPENPROJECT_DISABLE_DEV_ASSET_PROXY=true ./bin/rails s`'
echo '- Angular CLI: `cd frontend && npm run build:watch`'
echo ''
echo 'Once you are done: keep in mind to remove the public/assets folder or run the setup_dev script.'

@ -11,8 +11,8 @@ printf "Bundling rails dependencies ... "
try 'bundle install > log/setup_dev.log' try 'bundle install > log/setup_dev.log'
echo "done." echo "done."
echo "Removing public frontend assets" echo "Removing public assets"
try 'rm -rf public/assets/frontend >> log/setup_dev.log' try 'rm -rf public/assets >> log/setup_dev.log'
echo "Installing node_modules ... " echo "Installing node_modules ... "
try '(cd frontend && npm ci) >> log/setup_dev.log' try '(cd frontend && npm ci) >> log/setup_dev.log'

@ -81,6 +81,8 @@ OpenProject::Application.configure do
# Send mails to browser window # Send mails to browser window
config.action_mailer.delivery_method = :letter_opener config.action_mailer.delivery_method = :letter_opener
config.hosts << 'bs-local.com' if ENV['OPENPROJECT_DISABLE_DEV_ASSET_PROXY'].present?
end end
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT) unless String(ENV["SILENCE_SQL_LOGS"]).to_bool ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT) unless String(ENV["SILENCE_SQL_LOGS"]).to_bool

Loading…
Cancel
Save