Nessuna descrizione http://j1x-huginn.herokuapp.com

deploy.rb 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. default_run_options[:pty] = true
  2. set :application, "huginn"
  3. set :deploy_to, "/home/you/app"
  4. set :user, "you"
  5. set :use_sudo, false
  6. set :scm, :git
  7. set :rails_env, 'production'
  8. set :repository, "git@github.com:you/huginn-private.git"
  9. set :branch, "master"
  10. set :deploy_via, :remote_cache
  11. set :keep_releases, 5
  12. set :bundle_without, [:development]
  13. server "yourdomain.com", :app, :web, :db, :primary => true
  14. set :sync_backups, 3
  15. before 'deploy:restart', 'deploy:migrate'
  16. after 'deploy', 'deploy:cleanup'
  17. set :bundle_without, [:development, :test]
  18. after 'deploy:update_code', 'deploy:symlink_configs'
  19. after 'deploy:update', 'foreman:export'
  20. after 'deploy:update', 'foreman:restart'
  21. namespace :deploy do
  22. desc 'Link the .env environment and Procfile from shared/config into the new deploy directory'
  23. task :symlink_configs, :roles => :app do
  24. run <<-CMD
  25. cd #{latest_release} && ln -nfs #{shared_path}/config/.env #{latest_release}/.env
  26. cd #{latest_release} && ln -nfs #{shared_path}/config/Procfile #{latest_release}/Procfile
  27. CMD
  28. end
  29. end
  30. namespace :foreman do
  31. desc "Export the Procfile to Ubuntu's upstart scripts"
  32. task :export, :roles => :app do
  33. run "cd #{latest_release} && rvmsudo bundle exec foreman export upstart /etc/init -a #{application} -u #{user} -l #{deploy_to}/upstart_logs"
  34. end
  35. desc 'Start the application services'
  36. task :start, :roles => :app do
  37. sudo "sudo start #{application}"
  38. end
  39. desc 'Stop the application services'
  40. task :stop, :roles => :app do
  41. sudo "sudo stop #{application}"
  42. end
  43. desc 'Restart the application services'
  44. task :restart, :roles => :app do
  45. run "sudo start #{application} || sudo restart #{application}"
  46. end
  47. end
  48. # If you want to use rvm on your server and have it maintained by Capistrano, uncomment these lines:
  49. # set :rvm_ruby_string, '1.9.3-p286@huginn'
  50. # set :rvm_type, :user
  51. # before 'deploy', 'rvm:install_rvm'
  52. # before 'deploy', 'rvm:install_ruby'
  53. # require "rvm/capistrano"
  54. # Load Capistrano additions
  55. Dir[File.expand_path("../../lib/capistrano/*.rb", __FILE__)].each{|f| load f }
  56. require "bundler/capistrano"
  57. load 'deploy/assets'