PageRenderTime 72ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/app/config/deploy.rb

https://bitbucket.org/vicentgodella/opengestia
Ruby | 73 lines | 43 code | 21 blank | 9 comment | 0 complexity | ffd32b26e174947b49077f5dab2338de MD5 | raw file
Possible License(s): GPL-3.0
  1. set :application, "Opengestia"
  2. set :domain, "opengestia.juniorsmd.org"
  3. set :deploy_to, "/ebs/www/opengestia/"
  4. set :app_path, "app"
  5. set :user, "ubuntu"
  6. set :use_sudo, false
  7. set :ssh_options, {:forward_agent => true}
  8. default_run_options[:pty] = true
  9. set :repository, "git@bitbucket.org:vicentgodella/opengestia.git"
  10. set :scm, :git
  11. # Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, `subversion` or `none`
  12. set :branch, "master"
  13. set :model_manager, "doctrine"
  14. # Or: `propel`
  15. role :web, domain # Your HTTP server, Apache/etc
  16. role :app, domain # This may be the same as your `Web` server
  17. role :db, domain, :primary => true # This is where Rails migrations will run
  18. set :keep_releases, 5
  19. set :shared_files, ["app/config/parameters.yml"]
  20. set :shared_children, [app_path + "/cache", app_path + "/logs"]
  21. set :update_vendors, false
  22. #set :composer_bin, '/usr/local/bin/composer'
  23. set :use_composer, true
  24. set :admin_runner, "ubuntu"
  25. set :dump_assetic_assets, true
  26. set :interactive_mode, true
  27. logger.level = Logger::MAX_LEVEL
  28. # Change ACL on the app/logs and app/cache directories
  29. after 'deploy', 'deploy:update_acl'
  30. # This is a custom task to set the ACL on the app/logs and app/cache directories
  31. namespace :deploy do
  32. task :update_acl, :roles => :app do
  33. shared_dirs = [
  34. app_path + "/logs",
  35. app_path + "/cache"
  36. ]
  37. # add group write permissions
  38. run "cd #{latest_release} && sudo chmod 777 #{shared_dirs.join(' ')} -R"
  39. # Allow directories to be writable by webserver and this user
  40. #run "cd #{latest_release} && sudo setfacl -R -m u:www-data:rwx -m u:#{user}:rwx #{shared_dirs.join(' ')}"
  41. #run "cd #{latest_release} && sudo setfacl -dR -m u:www-data:rwx -m u:#{user}:rwx #{shared_dirs.join(' ')}"
  42. end
  43. end
  44. task :upload_parameters do
  45. origin_file = "app/config/parameters.yml"
  46. destination_file = shared_path + "/app/config/parameters.yml" # Notice the
  47. shared_path
  48. try_sudo "mkdir -p #{File.dirname(destination_file)}"
  49. top.upload(origin_file, destination_file)
  50. end
  51. after "deploy:setup", "upload_parameters"
  52. after "deploy", "deploy:cleanup"