PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/config/deploy.rb

https://bitbucket.org/h6165/seatfoo
Ruby | 68 lines | 29 code | 12 blank | 27 comment | 0 complexity | 8a5c26157190238e74b385e016bccdd1 MD5 | raw file
  1. set :application, "seatfoo"
  2. set :use_sudo, false
  3. set :scm, :git
  4. set :repository, "git@bitbucket.org:h6165/seatfoo.git"
  5. set :branch, "master"
  6. set :deploy_via, :remote_cache
  7. set :user, "deployer"
  8. set :password, "deployer"
  9. set :deploy_to, "/home/deployer/www/seatfoo/"
  10. set :app_site, "50.116.3.248"
  11. role :web, app_site # Your HTTP server, Apache/etc
  12. role :app, app_site # This may be the same as your `Web` server
  13. role :db, app_site, :primary => true # This is where Rails migrations will run
  14. # bundler stuff
  15. #set :bundle_cmd, "/usr/local/rvm/gems/ruby-1.9.2-p290/bin/bundle"
  16. #set :bundle_flags, "--deployment"
  17. # unicorn stuff (src: https://gist.github.com/393178)
  18. set :rails_env, :production
  19. set :unicorn_cmd, "bundle exec unicorn_rails"
  20. set :unicorn_config, "#{current_path}/config/unicorn.rb"
  21. set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
  22. # whenever stuff
  23. #set :whenever_command, "bundle exec whenever"
  24. #require "whenever/capistrano"
  25. namespace :deploy do
  26. #task :bundle, :roles => :app, :except => { :no_release => true } do
  27. # run "cd #{current_path} && #{bundle_cmd} install --path /home/deployer/www/shared/bundle --without development test"
  28. #end
  29. task :start, :roles => :app, :except => { :no_release => true } do
  30. # cd /home/deployer/www/seatfoo/current
  31. # bundle exec unicorn_rails -c config/unicorn.rb -E production -D
  32. run "cd #{current_path} && #{unicorn_cmd} -c #{unicorn_config} -E #{rails_env} -D"
  33. end
  34. task :stop, :roles => :app, :except => { :no_release => true } do
  35. # cd /home/deployer/www/seatfoo/current
  36. # kill -9 `cat tmp/pids/unicorn.pid`
  37. run "kill -9 `cat #{unicorn_pid}`"
  38. end
  39. #task :graceful_stop, :roles => :app, :except => { :no_release => true } do
  40. # run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`"
  41. #end
  42. #task :reload, :roles => :app, :except => { :no_release => true } do
  43. # run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`"
  44. #end
  45. task :restart, :roles => :app, :except => { :no_release => true } do
  46. stop
  47. start
  48. end
  49. end
  50. #namespace :rake do
  51. # desc "Run a task on a remote server."
  52. # # run like: cap rake:invoke task=a_certain_task
  53. # task :invoke do
  54. # run("cd #{current_path}; bundle exec rake #{ENV['task']} RAILS_ENV=#{rails_env}")
  55. # end
  56. #end