Guest User

Untitled

a guest
Feb 21st, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. namespace :pushr do
  2. set :pushr_path, "#{deploy_to}/pushr"
  3.  
  4. desc "Install pushr"
  5. task :install do
  6. run "git clone git://github.com/karmi/pushr.git #{pushr_path}"
  7. end
  8.  
  9. task :check do
  10. run "cd #{pushr_path}; rake app:check"
  11. end
  12.  
  13. desc "Create config.yml"
  14. task :configure do
  15. set :http_auth_username, Capistrano::CLI.ui.ask("Enter new user name for http access: ")
  16. set :http_auth_password, Capistrano::CLI.password_prompt("Enter new password for http access: ")
  17. pushr_configuration =<<-EOF
  18. application: #{application}
  19.  
  20. # Username/password for HTTP Auth
  21. username: #{http_auth_username}
  22. password: #{http_auth_password}
  23.  
  24. # Full path to your Rails application, eg. "/var/www/my_rails_app"
  25. path: #{deploy_to}
  26. EOF
  27. put pushr_configuration, "#{pushr_path}/config.yml"
  28. end
  29.  
  30. desc "Start pushr"
  31. task :start do
  32. run "cd #{pushr_path}; rake start"
  33. end
  34.  
  35. desc "Stop pushr"
  36. task :stop do
  37. run "cd #{pushr_path}; rake stop"
  38. end
  39.  
  40. namespace :ssh do
  41. desc "Generate ssh key"
  42. task :generate_key do
  43. run "ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ''"
  44. end
  45.  
  46. desc "Authorize local key for accessing the same server"
  47. task :authorize_key do
  48. run "cd #{pushr_path}; rake app:add_public_key_to_localhost"
  49. end
  50.  
  51. desc "Display public ssh key"
  52. task :get_public_key do
  53. run "cat ~/.ssh/id_rsa.pub"
  54. end
  55. end
  56.  
  57. end
Add Comment
Please, Sign In to add comment