PageRenderTime 86ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/config/deploy.rb

https://bitbucket.org/emagid/eisenberg_barmitzvah
Ruby | 85 lines | 50 code | 15 blank | 20 comment | 0 complexity | 7ad432e2b29d99efe11344cfab1b633e MD5 | raw file
Possible License(s): LGPL-2.1, MPL-2.0-no-copyleft-exception
  1. # config valid only for current version of Capistrano
  2. lock '3.4.0'
  3. set :application, 'american_grown'
  4. set :repo_url, 'git@bitbucket.org:emagid/americangrowndiamonds.git'
  5. # Default branch is :master
  6. # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
  7. set :user, "betaamericangrow"
  8. # Default deploy_to directory is /var/www/my_app_name
  9. set :deploy_to, "/home/betaamericangrow/american"
  10. # Default value for :scm is :git
  11. set :scm, :git
  12. # Default value for :format is :pretty
  13. set :format, :pretty
  14. # Default value for :log_level is :debug
  15. set :log_level, :debug
  16. set :tmp_dir, "/home/betaamericangrow/tmp"
  17. # Default value for :pty is false
  18. # set :pty, true
  19. # Default value for :linked_files is []
  20. # set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
  21. # Default value for linked_dirs is []
  22. # set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
  23. # Default value for default_env is {}
  24. # set :default_env, { path: "/opt/ruby/bin:$PATH" }
  25. # Default value for keep_releases is 5
  26. set :keep_releases, 3
  27. namespace :file do
  28. desc "Add Emagid lib"
  29. task :update_emaigd_lib do
  30. on roles(:app) do
  31. within current_path do
  32. execute :rm, "-rf libs/Emagid"
  33. execute :git, "init"
  34. execute :git, "submodule add git@bitbucket.org:emagid/emagidphp.git libs/Emagid"
  35. within "libs/Emagid" do
  36. execute :git, "checkout dev"
  37. end
  38. end
  39. end
  40. end
  41. desc "Change index.php permission"
  42. task :permission_index do
  43. on roles(:app) do
  44. # execute :pwd
  45. # execute :echo, "#{current_path}"
  46. # execute :cd, "#{current_path}"
  47. # execute :chmod, '755 index.php'
  48. end
  49. end
  50. end
  51. namespace :config do
  52. desc "Create db config file symbol link"
  53. task :db do
  54. on roles(:app) do
  55. execute :ln, "-s #{shared_path}/emagid.db.php #{release_path}/conf/"
  56. end
  57. end
  58. task :uploads do
  59. on roles(:app) do
  60. execute :rm, "-rf #{release_path}/content/uploads"
  61. execute :ln, "-s #{shared_path}/uploads #{release_path}/content/uploads"
  62. end
  63. end
  64. end
  65. namespace :deploy do
  66. after :finished, "file:update_emaigd_lib"
  67. after :finished, "config:db"
  68. after :finished, "config:uploads"
  69. after :finished, "file:permission_index"
  70. end