PageRenderTime 41ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/config/deploy.rb

https://bitbucket.org/srmoscow/hanzi
Ruby | 71 lines | 34 code | 26 blank | 11 comment | 0 complexity | d1c98e9b90a4d531ebd2dc513583317c MD5 | raw file
  1. $:<< File.join(File.dirname(__FILE__), '..')
  2. require "bundler/capistrano"
  3. require 'caplock'
  4. require 'rvm/capistrano'
  5. ### GIT configuration
  6. set :keep_releases, 5
  7. set :scm, :git
  8. set :application, 'hanzi'
  9. # set :repository, "https://srmoscow@bitbucket.org/srmoscow/hanzi.git"
  10. set :repository, "ssh://git@bitbucket.org/srmoscow/hanzi.git"
  11. set :branch, 'master'
  12. set :deploy_via, :remote_cache
  13. set :scm_user, "srmoscow"
  14. # ssh_options[:forward_agent] = true
  15. set :ssh_options, { :forward_agent => true }
  16. # RVM configuration
  17. set :rvm_ruby_string, 'ruby-1.9.3-p327-falcon@hanzi' # use the same ruby as used locally for deployment
  18. set :rvm_autolibs_flag, "read-only" # more info: rvm help autolibs
  19. set :rvm_type, :system
  20. set :rvm_install_with_sudo, true
  21. before 'deploy:setup', 'rvm:install_rvm' # install RVM
  22. before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset, OR:
  23. before 'deploy:setup', 'rvm:create_gemset' # only create gemset
  24. # Deployment configuration
  25. set :deploy_to ,"/var/www/#{application}"
  26. role :web, "dohanzi.stephenrichards.eu" # Your HTTP server, Apache/etc
  27. role :app, "dohanzi.stephenrichards.eu" # This may be the same as your `Web` server
  28. role :db, "dohanzi.stephenrichards.eu", :primary => true # This is where Rails migrations will run
  29. # role :db, "your slave db-server here"
  30. set :use_sudo, false
  31. set :user, 'deploy'
  32. default_run_options[:pty] = true
  33. after 'deploy:update_code', 'deploy:migrate'
  34. # if you want to clean up old releases on each deploy uncomment this:
  35. # after "deploy:restart", "deploy:cleanup"
  36. # if you're still using the script/reaper helper you will need
  37. # these http://github.com/rails/irs_process_scripts
  38. # If you are using Passenger mod_rails uncomment this:
  39. namespace :deploy do
  40. task :start do ; end
  41. task :stop do ; end
  42. task :restart, :roles => :app, :except => { :no_release => true } do
  43. run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  44. end
  45. end