Posted By

chrisaiv on 08/29/10


Tagged

ruby capistrano


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

kentonnewby


Capistrano: MediaTemple


 / Published in: Ruby
 

  1. require "mt-capistrano"
  2.  
  3. set :svn, "wallofscholars"
  4. set :application, "wallofscholars"
  5. set :webpath, "subdomain.domain.com" # could also be "myapp.crappy.com"
  6. set :domain, "serveronrails.com"
  7. set :site, "xxxxx"
  8. set :user, "[email protected]"
  9. set :password, "password"
  10.  
  11. # repository on (gs)
  12. set :repository, "svn+ssh://#{user}@#{domain}/home/#{site}/data/svn/repository/#{svn}/trunk"
  13.  
  14. # repository elsewhere
  15. #set :repository, "svn+ssh://[email protected]/usr/local/svn/repo/app1/trunk"
  16. #set :repository, "https://other.com/usr/local/svn/repo/app1/trunk"
  17. #set :scm_password, "xxxxxxxx"
  18. #set :scm, :subversion
  19. set :use_sudo, false
  20.  
  21. # necessary for functioning on the (gs)
  22. default_run_options[:pty] = true
  23.  
  24. # these shouldn't be changed
  25. role :web, "#{domain}"
  26. role :app, "#{domain}"
  27. role :db, "#{domain}", :primary => true
  28. set :deploy_to, "/home/#{site}/containers/rails/#{application}"
  29.  
  30. # We override mt-capistrano set(:rake) because it sets RUBYLIB incorrectly!!!
  31. # see: http://www.mail-archive.com/[email protected]/msg06084.html
  32. set(:rake) { "PATH=$PATH:/home/#{site}/data/rubygems/gems/bin/ RUBYLIB=/home/#{site}/data/rubygems/local/lib/site_ruby/1.8:/home/#{site}/data/rubygems/lib GEM_HOME=/home/#{site}/data/rubygems/gems rake" }
  33.  
  34. #???!!!which rake which rubygem which gem
  35. set :deploy_via, :export
  36.  
  37. # uncomment if desired
  38. #after "deploy:update_code".to_sym do
  39. # put File.read("deploy/database.yml.mt"), "{release_path}/config/database.yml", :mode => 0444
  40. #end
  41.  
  42. #task :after_update_code, :roles => :app do
  43. # run "ln -nfs /home/#{site}/containers/rails/#{application}/shared/system/uploads #{release_path}/public/uploads"
  44. #end
  45.  
  46. # update .htaccess rules after new version is deployed
  47. after "deploy:restart", "mt:generate_htaccess", "mt:create_link"

Report this snippet  

You need to login to post a comment.