Guest User

Untitled

a guest
Mar 11th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. default_run_options[:pty] = true
  2.  
  3. #set :scm_username, Proc.new{ Capistrano::CLI.password_prompt('SVN User: ') }
  4. #set :scm_password, Proc.new { Capistrano::CLI.password_prompt('SVN Password: ') }
  5.  
  6. set :application, "myapp"
  7. set :domain, "localhost"
  8.  
  9.  
  10. set :repository, "svn+ssh://#{domain}/var/www/apps/#{application}/repos/trunk"
  11.  
  12.  
  13. set :deploy_to, "/var/www/apps/#{application}"
  14. # If you aren't deploying to /u/apps/#{application} on the target
  15. # servers (which is the default), you can specify the actual location
  16. # via the :deploy_to variable:
  17. # set :deploy_to, "/var/www/#{application}"
  18.  
  19. # If you aren't using Subversion to manage your source code, specify
  20. # your SCM below:
  21. # set :scm, :subversion
  22.  
  23. role :app, "localhost"
  24. role :web, "localhost"
  25. role :db, "localhost", :primary => true
  26.  
  27. set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"
  28.  
  29. desc "Restart apache"
  30. task :restart_apache, :roles => :app do
  31. sudo "/etc/init.d/apache2 reload"
  32. end
  33.  
  34.  
  35.  
  36.  
  37.  
  38. # Capistrano 2.0 doesn't work with the mongrel recipes, so we need to override the defaults ourselves.
  39. namespace :deploy do
  40. namespace :mongrel do
  41. [ :stop, :start, :restart ].each do |t|
  42. desc "#{t.to_s.capitalize} the mongrel appserver"
  43. task t, :roles => :app do
  44. #invoke_command checks the use_sudo variable to determine how to run the mongrel_rails command
  45. invoke_command "mongrel_rails cluster::#{t.to_s} -C #{mongrel_conf}", :via => run_method
  46. end
  47. end
  48. end
  49.  
  50. namespace :memcached do
  51. [ :stop, :start, :restart ].each do |t|
  52. desc "#{t.to_s.capitalize} the memcached appserver"
  53. task t, :roles => :app do
  54. #invoke_command checks the use_sudo variable to determine how to run the memcached command
  55. sudo "/etc/init.d/memcached #{t.to_s}"
  56. end
  57. end
  58. end
  59.  
  60. desc "Custom restart task for mongrel cluster"
  61. task :restart, :roles => :app, :except => { :no_release => true } do
  62. deploy.costum_tasks
  63. deploy.mongrel.restart
  64. end
  65.  
  66.  
  67. desc "Custom start task for mongrel cluster"
  68. task :start, :roles => :app do
  69. deploy.costum_tasks
  70. deploy.mongrel.start
  71. end
  72.  
  73.  
  74. desc "Custom stop task for mongrel cluster"
  75. task :stop, :roles => :app do
  76. deploy.mongrel.stop
  77. end
  78.  
  79. desc "Memcached restart task"
  80. task :memcached_restart, :roles => :app do
  81. deploy.memcached.restart
  82. end
  83.  
  84. desc "Memcached start task"
  85. task :memcached_start, :roles => :app do
  86. deploy.memcached.start
  87. end
  88.  
  89. desc "Memcached stop task"
  90. task :memcached_stop, :roles => :app do
  91. deploy.memcached.stop
  92. end
  93.  
  94. desc "Rake makemo"
  95. task :rake_makemo, :roles => :app do
  96. run "rake makemo"
  97. end
  98.  
  99. desc "stop and start memcached ,migrate and rakedb tasks"
  100. task :costum_tasks, :roles => :app do
  101. deploy.memcached_stop
  102. deploy.migrate
  103. deploy.makemo
  104. deploy.memcached_start
  105. end
  106.  
  107. #desc "Rake db migrate"
  108. #task :rake_db, :roles => :app do
  109. # run "rake db:migrate"
  110. #end
  111.  
  112.  
  113. #desc "Deploys d1g project"
  114. #task :deploy_d1g ,:roles => :app do
  115. #stoping mongrel
  116. #deploy.stop
  117. #
  118. #deploy.start
  119. #deploy.memcached_stop
  120. #deploy.memcached_start
  121. #end
  122. end
Add Comment
Please, Sign In to add comment