run_thin.py 583 B

12345678910111213141516171819
  1. import os
  2. import helper
  3. from helper import Command
  4. def start(args, logfile, errfile):
  5. db_host = "DB_HOST={0}".format(args.database_host or 'localhost')
  6. start_server = db_host + " rvm ruby-2.0.0-p0 do bundle exec thin start -C config/thin.yml"
  7. commands = [
  8. Command("rvm ruby-2.0.0-p0 do bundle --jobs 4", True),
  9. Command(start_server, False)
  10. ]
  11. return helper.run(commands, logfile, errfile, args.troot)
  12. def stop(logfile, errfile):
  13. helper.run([Command('rm -rf tmp/*', True)], logfile, errfile, os.environ['TROOT'])
  14. return helper.stop('thin', logfile, errfile)