run_thin.py 489 B

12345678910111213
  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.1.2 do bundle exec thin start -C config/thin.yml"
  7. return helper.run([Command(start_server, False)], logfile, errfile, args.troot)
  8. def stop(logfile, errfile):
  9. helper.run([Command('rm -rf tmp/*', True)], logfile, errfile, os.environ['TROOT'])
  10. return helper.stop('thin', logfile, errfile)