test_startup.sh 761 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. RAILS_ENV=$1
  3. APP_PORT=$2
  4. WS_PORT=$3
  5. WITH_DB=$4 || 0
  6. if test $WITH_DB -eq 1; then
  7. script/bootstrap.sh
  8. fi
  9. export ZAMMAD_SETTING_TTL=15
  10. rails r "Setting.set('developer_mode', true)"
  11. rails r "Setting.set('websocket_port', '$WS_PORT')"
  12. rails r "Setting.set('fqdn', '$IP:$BROWSER_PORT')"
  13. rails r "Setting.set('chat_agent_idle_timeout', '45')"
  14. echo "env used for script/build/test_startup.sh $1 $2 $3"
  15. echo "export RAILS_ENV=$RAILS_ENV"
  16. echo "export IP=$IP"
  17. echo "export BROWSER_PORT=$BROWSER_PORT"
  18. #rails s puma -d --pid tmp/pids/server.pid --bind 0.0.0.0 --port $APP_PORT
  19. bundle exec puma --pidfile tmp/pids/server.pid -d -p $APP_PORT -e $RAILS_ENV
  20. bundle exec script/websocket-server.rb start -d -p $WS_PORT
  21. bundle exec script/scheduler.rb start