PageRenderTime 31ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/config/deploy.rb

https://bitbucket.org/purefame/purefame
Ruby | 97 lines | 25 code | 25 blank | 47 comment | 0 complexity | ac362833ea0956dd7827c5db2b469762 MD5 | raw file
  1. # config valid for current version and patch releases of Capistrano
  2. lock "~> 3.10.1"
  3. set :application, "purefame"
  4. set :repo_url, "git@bitbucket.org:purefame/purefame.git"
  5. # Default branch is :master
  6. ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
  7. set :stages, ["staging", "production"]
  8. set :default_stage, "staging"
  9. # Defaults to :db role
  10. #set :migration_role, :db
  11. set :migration_role, :app
  12. # Defaults to the primary :db server
  13. set :migration_servers, -> { primary(fetch(:migration_role)) }
  14. # Defaults to false
  15. # Skip migration if files in db/migrate were not modified
  16. set :conditionally_migrate, true
  17. # Defaults to [:web]
  18. set :assets_roles, [:web, :app]
  19. # Defaults to 'assets'
  20. # This should match config.assets.prefix in your rails config/application.rb
  21. #set :assets_prefix, 'prepackaged-assets'
  22. # RAILS_GROUPS env value for the assets:precompile task. Default to nil.
  23. set :rails_assets_groups, :assets
  24. # If you need to touch public/images, public/javascripts, and public/stylesheets on each deploy
  25. set :normalize_asset_timestamps, %w{public/images public/javascripts public/stylesheets}
  26. # Defaults to nil (no asset cleanup is performed)
  27. # If you use Rails 4+ and you'd like to clean up old assets after each deploy,
  28. # set this to the number of versions to keep
  29. set :keep_assets, 2
  30. # Default value for :format is :airbrussh.
  31. # set :format, :airbrussh
  32. # You can configure the Airbrussh format using :format_options.
  33. # These are the defaults.
  34. # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
  35. # Default value for :pty is false
  36. # set :pty, true
  37. # Default value for :linked_files is []
  38. # append :linked_files, "config/database.yml", "config/secrets.yml"
  39. # Default value for linked_dirs is []
  40. # append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"
  41. append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', '.bundle', 'public/system', 'public/uploads'
  42. append :linked_files, 'config/database.yml', 'config/secrets.yml'
  43. # Default value for default_env is {}
  44. # set :default_env, { path: "/opt/ruby/bin:$PATH" }
  45. # Default value for local_user is ENV['USER']
  46. # set :local_user, -> { `git config user.name`.chomp }
  47. # Default value for keep_releases is 5
  48. # set :keep_releases, 5
  49. # Uncomment the following to require manually verifying the host key before first deploy.
  50. # set :ssh_options, verify_host_key: :secure
  51. #namespace :deploy do
  52. # task :start do ; end
  53. # task :stop do ; end
  54. # task :restart, :roles => :app, :except => { :no_release => true } do
  55. # run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  56. # end
  57. #end
  58. ##after "deploy:update_code", :bundle_install
  59. #desc "Running the bundle install"
  60. #task :bundle_install, :roles => :app do
  61. # run "cd #{release_path} && bundle install"
  62. #end
  63. namespace :deploy do
  64. after :restart, :restart_passenger do
  65. on roles(:web), in: :groups, limit: 3, wait: 10 do
  66. within release_path do
  67. execute :touch, 'tmp/restart.txt'
  68. end
  69. end
  70. end
  71. after :finishing, 'deploy:restart_passenger'
  72. end