Guest User

Untitled

a guest
Jan 5th, 2018
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.76 KB | None | 0 0
  1. $ ssh deploy@myserver.com
  2.  
  3. deploy@MyServer:~$ ssh -T git@gitlab.com
  4. debug1: client_input_channel_open: ctype auth-agent@openssh.com rchan 2 win 65536 max 16384
  5. debug1: channel 1: new [authentication agent connection]
  6. debug1: confirm auth-agent@openssh.com
  7. Welcome to GitLab, Alexander!debug1: channel 1: FORCE input drain
  8.  
  9. set :application, "myapp"
  10. set :branch, "master"
  11. set :repo_url, "git@gitlab.com:MyApp/myapp.git"
  12.  
  13. # Defaults to false
  14. # Skip migration if files in db/migrate were not modified
  15. set :conditionally_migrate, true
  16.  
  17. set :ssh_options, { forward_agent: true }
  18.  
  19. set :rvm_ruby_version, '2.2.6'
  20.  
  21. # Default deploy_to directory is /var/www/my_app_name
  22. set :deploy_to, "/var/www/#{fetch(:application)}/"
  23. set :deploy_user, "deploy"
  24.  
  25. # Tells Capistrano to store config/database.yml file inside a directory called /shared, which is meant for any files
  26. # we want to persist between deploys
  27. set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
  28.  
  29. # Directories that are meant to persist between deploys, and they will also be stored inside /shared
  30. set :linked_dirs, fetch(:linked_dirs, []).push('bin', 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
  31.  
  32. # The specs that should be run before deployment is allowed to continue
  33. set :tests, []
  34.  
  35. # Delayed Job Config: https://github.com/AgileConsultingLLC/capistrano3-delayed-job
  36. set :delayed_job_workers, 3
  37.  
  38. # Keep the last 5 deploys for rollback purposes
  39. set :keep_releases, 5
  40.  
  41. namespace :deploy do
  42. after :restart, :clear_cache do
  43. on roles(:web), in: :groups, limit: 3, wait: 10 do
  44. # Here we can do anything such as:
  45. # within release_path do
  46. # execute :rake, 'cache:clear'
  47. # end
  48. end
  49. end
  50. end
  51.  
  52. set :stage, :staging
  53. set :rails_env, :staging
  54.  
  55. role :app, %w{deploy@myserver.com}
  56. role :web, %w{deploy@myserver.com}
  57. role :db, %w{deploy@myserver.com}
  58.  
  59. $ bundle exec cap staging deploy --trace
  60. ** Invoke staging (first_time)
  61. ** Execute staging
  62. ** Invoke load:defaults (first_time)
  63. ** Execute load:defaults
  64. ** Invoke rvm:hook (first_time)
  65. ** Invoke passenger:rvm:hook (first_time)
  66. ** Invoke passenger:test_which_passenger (first_time)
  67. ** Execute passenger:test_which_passenger
  68. ** Execute passenger:rvm:hook
  69. ** Execute rvm:hook
  70. ** Invoke rvm:check (first_time)
  71. ** Execute rvm:check
  72. rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
  73. ruby-2.2.6
  74. ruby 2.2.6p396 (2016-11-15 revision 56800) [x86_64-linux]
  75. ** Invoke bundler:map_bins (first_time)
  76. ** Invoke passenger:bundler:hook (first_time)
  77. ** Execute passenger:bundler:hook
  78. ** Execute bundler:map_bins
  79. ** Invoke deploy:set_rails_env (first_time)
  80. ** Execute deploy:set_rails_env
  81. ** Invoke deploy:set_linked_dirs (first_time)
  82. ** Execute deploy:set_linked_dirs
  83. ** Invoke deploy:set_rails_env
  84. ** Invoke deploy (first_time)
  85. ** Execute deploy
  86. ** Invoke deploy:starting (first_time)
  87. ** Execute deploy:starting
  88. ** Invoke deploy:check (first_time)
  89. ** Invoke git:check (first_time)
  90. ** Invoke git:wrapper (first_time)
  91. ** Execute git:wrapper
  92. 00:00 git:wrapper
  93. 01 mkdir -p /tmp
  94. ✔ 01 deploy@myserver.com 0.286s
  95. Uploading /tmp/git-ssh-myapp-staging-localuser.sh 100.0%
  96. 02 chmod 700 /tmp/git-ssh-myapp-staging-localuser.sh
  97. ✔ 02 deploy@myserver.com 0.277s
  98. ** Execute git:check
  99. 00:01 git:check
  100. 01 git ls-remote git@gitlab.com:MyApp/myapp.git HEAD
  101. 01 Permission denied (publickey).
  102. 01 fatal: Could not read from remote repository.
  103. 01
  104. 01 Please make sure you have the correct access rights
  105. 01 and the repository exists.
  106. cap aborted!
  107. SSHKit::Runner::ExecuteError: Exception while executing as deploy@myserver.com: git exit status: 128
  108. git stdout: Nothing written
  109. git stderr: Permission denied (publickey).
  110. fatal: Could not read from remote repository.
  111.  
  112. Please make sure you have the correct access rights
  113. and the repository exists.
  114. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute'
  115. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
  116.  
  117. Caused by:
  118. SSHKit::Command::Failed: git exit status: 128
  119. git stdout: Nothing written
  120. git stderr: Permission denied (publickey).
  121. fatal: Could not read from remote repository.
  122.  
  123. Please make sure you have the correct access rights
  124. and the repository exists.
  125. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/command.rb:99:in `exit_status='
  126. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/netssh.rb:169:in `execute_command'
  127. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/abstract.rb:141:in `block in create_command_and_execute'
  128. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/abstract.rb:141:in `tap'
  129. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute'
  130. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/abstract.rb:74:in `execute'
  131. C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.10.1/lib/capistrano/scm/git.rb:77:in `git'
  132. C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.10.1/lib/capistrano/scm/git.rb:38:in `check_repo_is_reachable'
  133. C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.10.1/lib/capistrano/scm/tasks/git.rake:19:in `block (4 levels) in eval_rakefile'
  134. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/abstract.rb:93:in `with'
  135. C:/Ruby22/lib/ruby/gems/2.2.0/gems/capistrano-3.10.1/lib/capistrano/scm/tasks/git.rake:18:in `block (3 levels) in eval_rakefile'
  136. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
  137. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/backends/abstract.rb:29:in `run'
  138. C:/Ruby22/lib/ruby/gems/2.2.0/gems/sshkit-1.15.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
  139. Tasks: TOP => deploy:check => git:check
  140. The deploy has failed with an error: Exception while executing as deploy@myserver.com: git exit status: 128
  141. git stdout: Nothing written
  142. git stderr: Permission denied (publickey).
  143. fatal: Could not read from remote repository.
  144.  
  145. Please make sure you have the correct access rights
  146. and the repository exists.
  147. ** Invoke deploy:failed (first_time)
  148. ** Execute deploy:failed
  149.  
  150.  
  151. ** DEPLOY FAILED
  152. ** Refer to log/capistrano.log for details. Here are the last 20 lines:
  153.  
  154.  
  155. DEBUG [6b6ba2d0] Finished in 0.471 seconds with exit status 0 (successful).
  156.  
  157. DEBUG [c6e2d7dc] Running ~/.rvm/bin/rvm 2.2.6 do ruby --version as deploy@myserver.com
  158.  
  159. DEBUG [c6e2d7dc] Command: ~/.rvm/bin/rvm 2.2.6 do ruby --version
  160.  
  161. DEBUG [c6e2d7dc] ruby 2.2.6p396 (2016-11-15 revision 56800) [x86_64-linux]
  162.  
  163. DEBUG [c6e2d7dc] Finished in 0.608 seconds with exit status 0 (successful).
  164.  
  165. INFO [fd5500a8] Running /usr/bin/env mkdir -p /tmp as deploy@myserver.com
  166.  
  167. DEBUG [fd5500a8] Command: /usr/bin/env mkdir -p /tmp
  168.  
  169. INFO [fd5500a8] Finished in 0.286 seconds with exit status 0 (successful).
  170.  
  171. DEBUG Uploading /tmp/git-ssh-myapp-staging-localuser.sh 0.0%
  172.  
  173. INFO Uploading /tmp/git-ssh-myapp-staging-localuser.sh 100.0%
  174.  
  175. INFO [f33d4873] Running /usr/bin/env chmod 700 /tmp/git-ssh-myapp-staging-localuser.sh as deploy@myserver.com
  176.  
  177. DEBUG [f33d4873] Command: /usr/bin/env chmod 700 /tmp/git-ssh-myapp-staging-localuser.sh
  178.  
  179. INFO [f33d4873] Finished in 0.277 seconds with exit status 0 (successful).
  180.  
  181. INFO [86d3cd5a] Running /usr/bin/env git ls-remote git@gitlab.com:MyApp/myapp.git HEAD as deploy@myserver.com
  182.  
  183. DEBUG [86d3cd5a] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-myapp-staging-localuser.sh" ; /usr/bin/env git ls-remote git@gitlab.com:MyApp/myapp.git HEAD )
  184.  
  185. DEBUG [86d3cd5a] Permission denied (publickey).
  186.  
  187. DEBUG [86d3cd5a] fatal: Could not read from remote repository.
  188.  
  189.  
  190.  
  191. Please make sure you have the correct access rights
  192.  
  193. and the repository exists.
Add Comment
Please, Sign In to add comment