Guest User

Untitled

a guest
Jun 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.18 KB | None | 0 0
  1. set :location, "captest"
  2.  
  3. role :web, "#{location}"                          # Your HTTP server, Apache/etc
  4. role :app, "#{location}"                          # This may be the same as your `Web` server
  5. role :db,  "#{location}", :primary => true # This is where Rails migrations will run
  6. set :use_sudo, false
  7. set :local_user, "aslaen"
  8. set :deploy_to, "/home/aslaen/#{application}"
  9. set :deploy_via, :copy
  10. set :copy_dir, "~/cap/tmp"
  11. set :copy_remote_dir, "/home/aslaen/cap/tmp"
  12.  
  13.  
  14. # Custom tasks for our hosting environment.
  15. namespace :remote do
  16.    
  17.     desc <<-DESC   
  18.     Fix permissions root:root other+x
  19.     DESC
  20.     task :fix_permissions do
  21.         print "fixing permissions again....,\n"
  22.         run "chown -R root:root #{latest_release}; chmod -R o=rX #{latest_release}"
  23.     desc <<-DESC
  24.     Create directory required by copy_remote_dir.
  25.     DESC
  26.     task :create_copy_remote_dir, :roles => :app do
  27.         print " creating #{copy_remote_dir},\n"
  28.         run "mkdir -p #{copy_remote_dir}"
  29.     desc <<-DESC
  30.     Create a symlink to the application
  31.     DESC
  32.     task :create_symlink, :roles => :web do
  33.         print " creating symlink /var/www/html/#{application} -> #{current_path},\n"
  34.         run "ln -s #{current_path} /var/www/html/#{application}"
  35.     end
  36.     end
  37.     end
  38. end
  39.  
  40.  
  41.  
  42. # Custom tasks for our local machine.
  43. namespace :local do
  44.     desc <<-DESC
  45.     Create directory required for copy_dir.
  46.     DESC
  47.     task :create_copy_dir do
  48.         print " creating #{copy_dir},\n"
  49.         system "mkdir -p #{copy_dir}"
  50.     end
  51. end
  52.  
  53. #   Callbacks
  54. before 'deploy:setup', 'local:create_copy_dir', 'remote:create_copy_remote_dir'
  55. after 'deploy:setup', 'remote:create_symlink'
  56. after 'deploy:symlink', 'remote:fix_permissions'
  57.  
  58. #namespace :deploy do
  59. # task :migrate do
  60. #   puts "    not doing migrate because not a Rails application."
  61. #  end
  62. #  task :finalize_update do
  63. #    puts "    not doing finalize_update because not a Rails application."
  64. #  end
  65. #  task :start do
  66. #    puts "    not doing start because not a Rails application."
  67. #  end
  68. #  task :stop do
  69. #    puts "    not doing stop because not a Rails application."
  70. #  end
  71. #  task :restart do
  72. #    puts "    not doing restart because not a Rails application."
  73. #  end
  74. #end
  75.  
  76. set :repository,  "./public"
  77. set :scm, :none
Add Comment
Please, Sign In to add comment