PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 2ms app.codeStats 0ms

/config/deploy.rb

https://bitbucket.org/blazetango/jiffeez
Ruby | 57 lines | 41 code | 8 blank | 8 comment | 0 complexity | 9ce15e32c05bc6ccf4a9c673c6c00a04 MD5 | raw file
  1. set :application, "jiffeez1"
  2. set :repository, "git@bitbucket.org:blazetango/jiffeez.git"
  3. set :scm, :git
  4. set :user, "ec2-user"
  5. set :use_sudo, false
  6. set :deploy_to, "/var/www/#{application}"
  7. set :scm_passphrase, "123123"
  8. set :rake,"rake"
  9. set :rails_env, "development"
  10. set :migrate_env,"development"
  11. set :migrate_target, :latest
  12. default_run_options[:pty] = true
  13. ssh_options[:forward_agent] = true
  14. ssh_options[:auth_methods] = "publickey"
  15. ssh_options[:keys] = "/home/chetan/jiffeez/jzsgtest2.pem"
  16. # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
  17. # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
  18. role :web, "ec2-54-251-218-190.ap-southeast-1.compute.amazonaws.com" # Your HTTP server, Apache/etc
  19. role :app, "ec2-54-251-218-190.ap-southeast-1.compute.amazonaws.com" # This may be the same as your `Web` server
  20. role :db, "ec2-54-251-218-190.ap-southeast-1.compute.amazonaws.com", :primary => true # This is where Rails migrations will run
  21. #role :db, "your slave db-server here"
  22. # if you want to clean up old releases on each deploy uncomment this:
  23. # after "deploy:restart", "deploy:cleanup"
  24. # if you're still using the script/reaper helper you will need
  25. # these http://github.com/rails/irs_process_scripts
  26. # If you are using Passenger mod_rails uncomment this:
  27. namespace :deploy do
  28. task :start do ; end
  29. task :stop do ; end
  30. task :restart, :roles => :app, :except => { :no_release => true } do
  31. run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  32. end
  33. task :run_migration do
  34. run "cd #{release_path} && rake db:migrate RAILS_ENV=development" #--deployment"
  35. end
  36. task :bundle_install do
  37. run "cd #{release_path} && bundle install" #--deployment"
  38. end
  39. task :start_worker do
  40. run "cd #{release_path} && ruby script/delayed_job restart RAILS_ENV=development"
  41. end
  42. task :start_clock do
  43. run "cd #{release_path} && clockworkd -c lib/scheduler.rb restart RAILS_ENV=development"
  44. end
  45. end
  46. after "deploy:update_code", "deploy:bundle_install"
  47. after "deploy:bundle_install", "deploy:run_migration"
  48. after "deploy:run_migration", "deploy:start_worker"
  49. after "deploy:start_worker", "deploy:start_clock"