Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. SSHKit::Runner::ExecuteError: Exception while executing as
  2. deploy@13.124.242.61: Exception while executing as
  3. deploy@13.124.242.61: rake exit status: 1
  4. rake stdout: rake aborted!
  5. ActiveRecord::NoDatabaseError: FATAL: database "deploy" does not exist
  6.  
  7. default: &default
  8. adapter: postgresql
  9. encoding: utf8
  10. # For details on connection pooling, see rails configuration guide
  11. # http://guides.rubyonrails.org/configuring.html#database-pooling
  12. pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  13.  
  14. production:
  15. <<: *default
  16. host: <%= ENV['DEPLOY_DATABASE_HOST'] %>
  17. port: <%= ENV['DEPLOY_DATABASE_PORT'] %>
  18. username: <%= ENV['DEPLOY_DATABASE_USERNAME'] %>
  19. password: <%= ENV['DEPLOY_DATABASE_PASSWORD'] %>
  20. database: <%= ENV['DEPLOY_DATABASE_DATABASE'] %>
  21.  
  22. default: &default
  23. adapter: postgresql
  24. encoding: utf8
  25. # For details on connection pooling, see Rails configuration guide
  26. # http://guides.rubyonrails.org/configuring.html#database-pooling
  27. pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  28.  
  29. development:
  30. <<: *default
  31. database: deploy_development
  32.  
  33. test:
  34. <<: *default
  35. database: deploy_test
  36.  
  37. production:
  38. <<: *default
  39. host: <%= ENV['DEPLOY_DATABASE_HOST'] %>
  40. port: <%= ENV['DEPLOY_DATABASE_PORT'] %>
  41. username: <%= ENV['DEPLOY_DATABASE_USERNAME'] %>
  42. password: <%= ENV['DEPLOY_DATABASE_PASSWORD'] %>
  43. database: <%= ENV['DEPLOY_DATABASE_DATABASE'] %>
  44.  
  45. ## Deploy
  46. # Use Capistrano for deployment
  47. gem 'capistrano-rbenv', '~> 2.0'
  48. gem 'capistrano-rbenv-install', '~> 1.2.0'
  49. gem 'capistrano-rails', group: :development
  50. gem 'capistrano3-puma' , group: :development
  51. gem 'capistrano-figaro-yml', '~> 1.0.2'
  52. gem 'capistrano-upload-config'
  53. gem 'capistrano3-nginx', '~> 2.0'
  54. gem 'capistrano-rails-collection'
  55.  
  56. # Load DSL and set up stages
  57. require 'capistrano/setup'
  58.  
  59. # Include default deployment tasks
  60. require 'capistrano/deploy'
  61.  
  62. # Include tasks from other gems included in your Gemfile
  63. require 'capistrano/rbenv'
  64. require 'capistrano/rbenv_install'
  65. require 'capistrano/bundler'
  66. require 'capistrano/rails/assets'
  67. require 'capistrano/rails/migrations'
  68. require 'capistrano/puma'
  69. require 'capistrano/figaro_yml'
  70. require 'capistrano/upload-config'
  71. require 'capistrano/puma/nginx' # if you want to upload a nginx site template
  72. require 'capistrano/nginx'
  73. install_plugin Capistrano::Puma
  74. install_plugin Capistrano::Puma::Nginx
  75.  
  76. require 'capistrano/rails/collection'
  77.  
  78. require "capistrano/scm/git"
  79. install_plugin Capistrano::SCM::Git
  80.  
  81. # Load custom tasks from `lib/capistrano/tasks` if you have any defined
  82. Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
  83.  
  84. # config valid only for current version of Capistrano
  85. lock "3.9.1"
  86.  
  87. set :application, "my_app_name"
  88. set :repo_url, "git@github.com:gitstar/my_app_name.git"
  89.  
  90. # cap production deploy BRANCH=master
  91. set :branch, ENV['BRANCH'] if ENV['BRANCH']
  92.  
  93. set :migration_role, :app
  94.  
  95. set :rbenv_type, :user # or :system, depends on your rbenv setup
  96. set :rbenv_ruby, File.read('.ruby-version').strip
  97.  
  98. # Default branch is :master
  99. # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
  100.  
  101. # Default deploy_to directory is /var/www/my_app_name
  102. set :deploy_to, '/home/deploy/apps/my_app_name'
  103.  
  104. # Default value for :scm is :git
  105. # set :scm, :git
  106.  
  107. # Default value for :format is :airbrussh.
  108. # set :format, :airbrussh
  109.  
  110. # You can configure the Airbrussh format using :format_options.
  111. # These are the defaults.
  112. # set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto
  113.  
  114. # Default value for :pty is false
  115. set :pty, true
  116.  
  117. # Default value for :linked_files is []
  118. set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
  119.  
  120. # Default value for linked_dirs is []
  121. set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system')
  122.  
  123. # Default value for default_env is {}
  124. # set :default_env, { path: "/opt/ruby/bin:$PATH" }
  125.  
  126. # Default value for keep_releases is 5
  127. # set :keep_releases, 5
  128.  
  129. before 'deploy:check:linked_files', 'config:push'
  130. before 'deploy:starting', 'figaro_yml:setup'
  131. after 'figaro_yml:setup', 'puma:nginx_config'
  132.  
  133. namespace :deploy do
  134. after :restart, :clear_cache do
  135. on roles(:web), in: :groups, limit: 3, wait: 10 do
  136. # Here we can do anything such as:
  137. # within release_path do
  138. # execute :rake, 'cache:clear'
  139. # end
  140. end
  141. end
  142. end
  143.  
  144. server 'xx.xxx.xxx.xx', user: 'deploy', roles: %w{app db web}
  145. set :nginx_server_name, 'xx.xxx.xxx.xx'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement