run_unicorn.py 600 B

1234567891011121314
  1. import helper
  2. from helper import Command
  3. def start(args, logfile, errfile):
  4. helper.set_database_host(args)
  5. commands = [Command("sudo /usr/local/nginx/sbin/nginx -c $TROOT/config/nginx.conf", True),
  6. Command("rvm ruby-2.0.0-p0 do bundle exec unicorn -E production -c config/unicorn.rb", False)]
  7. return helper.run(commands, logfile, errfile, args.troot)
  8. def stop(logfile, errfile):
  9. command = Command("sudo /usr/local/nginx/sbin/nginx -c $TROOT/config/nginx.conf -s stop ", True)
  10. helper.run([command], logfile, errfile, '.')
  11. return helper.stop('unicorn', logfile, errfile)