PageRenderTime 66ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/config/deploy.rb

https://bitbucket.org/panharabit/codehub
Ruby | 77 lines | 29 code | 20 blank | 28 comment | 0 complexity | 87308a9220eb3fce9896b99a82a00932 MD5 | raw file
  1. # config valid only for current version of Capistrano
  2. lock '3.5.0'
  3. set :application, 'my_app_name'
  4. set :repo_url, 'git@example.com:me/my_repo.git'
  5. # Default branch is :master
  6. # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
  7. # Default deploy_to directory is /var/www/my_app_name
  8. # set :deploy_to, '/var/www/my_app_name'
  9. # Default value for :scm is :git
  10. # set :scm, :git
  11. # Default value for :format is :airbrussh.
  12. # set :format, :airbrussh
  13. # You can configure the Airbrussh format using :format_options.
  14. # These are the defaults.
  15. # set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto
  16. # Default value for :pty is false
  17. # set :pty, true
  18. # Default value for :linked_files is []
  19. # set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
  20. # Default value for linked_dirs is []
  21. # set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system')
  22. # Default value for default_env is {}
  23. # set :default_env, { path: "/opt/ruby/bin:$PATH" }
  24. # Default value for keep_releases is 5
  25. # set :keep_releases, 5
  26. namespace :deploy do
  27. after :restart, :clear_cache do
  28. on roles(:web), in: :groups, limit: 3, wait: 10 do
  29. # Here we can do anything such as:
  30. # within release_path do
  31. # execute :rake, 'cache:clear'
  32. # end
  33. end
  34. end
  35. end
  36. # config valid only for current version of Capistrano
  37. lock '3.5.0'
  38. set :repo_url, 'https://panharabit@bitbucket.org/panharabit/codehub.git'
  39. # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
  40. set :user, 'panharacodehub'
  41. set :application, 'codehubacademy'
  42. set :rails_env, 'production'
  43. server '128.199.146.58', user: "#{fetch(:user)}", roles: %w{app db web}, primary: true
  44. set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}"
  45. set :pty, true
  46. set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml', 'config/puma.rb')
  47. set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
  48. set :config_example_suffix, '.example'
  49. set :config_files, %w{config/database.yml config/secrets.yml}
  50. set :puma_conf, "#{shared_path}/config/puma.rb"
  51. namespace :deploy do
  52. before 'check:linked_files', 'config:push'
  53. before 'check:linked_files', 'puma:config'
  54. before 'check:linked_files', 'puma:nginx_config'
  55. before 'deploy:migrate', 'deploy:db:create'
  56. after 'puma:smart_restart', 'nginx:restart'
  57. end