Я получаю следующую ошибку при развертывании приложения Rails 4 с помощью Capistrano 3
INFO [87512eb8] Running /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh as [email protected]
DEBUG [87512eb8] Command: /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh
INFO [87512eb8] Finished in 0.444 seconds with exit status 0 (successful).
INFO [1ec94dd1] Running /usr/bin/env git ls-remote --heads [email protected]:BoTreeConsultingTeam/magnificent.git as [email protected]
DEBUG [1ec94dd1] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/magnificent/git-ssh.sh /usr/bin/env git ls-remote --heads [email protected]:BoTreeConsultingTeam/magnificent.git )
DEBUG [1ec94dd1] ERROR: Repository not found.
DEBUG [1ec94dd1] fatal: Could not read from remote repository.
DEBUG [1ec94dd1]
DEBUG [1ec94dd1] Please make sure you have the correct access rights
DEBUG [1ec94dd1] and the repository exists.
Вот конфигурация capistrano.
конфигурации /deploy.rb
# config valid only for current version of Capistrano
lock '3.4.0'
set :application, 'magnificent'
set :repo_url, '[email protected]:BoTreeConsultingTeam/magnificent.git'
set :deploy_to, '/home/deploy/magnificent'
set :linked_files, %w{config/database.yml config/secrets.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
set :branch, 'develop' #set/ :branch,`git rev-parse --abbrev-ref HEAD`.chomp
set :ssh_options, { forward_agent: true }
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, 'deploy:restart'
after :finishing, 'deploy:cleanup'
end
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
production.rb
set :stage, :production
server 'xx.xx.xx.xx', user: 'deploy', roles: %w{web app}
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
set :rvm_type, :user
set :rvm_ruby_version, '2.2.2'
Я также скопировал /home/deploy/.ssh/id_rsa.pub удаленного сервера для развертывания ключей github.
UPDATE
Я подтверждаю, что я могу получить доступ к удаленному репо, а также команда GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/magnificent/git-ssh.sh /usr/bin/env git ls-remote --heads [email protected]:BoTreeConsultingTeam/magnificent.git
работает на удаленном сервере.