Я пытаюсь развернуть свое приложение Rails с Bitbucket в Digital Ocean. Я использую Git в качестве системы контроля версий, я сделал следующее:
- возьми ssh-ключ моего компьютера
pbcopy < ~/.ssh/id_rsa.pub
- добавить ssh-ключ моих компьютеров в Digital Ocean (https://cloud.digitalocean.com/ssh_keys)
- добавить ssh-ключ моих компьютеров в репозиторий Bitbucket в качестве ключа развертывания (
https://bitbucket.org/<account name>/<project admin/deploy-keys
)
но когда я запускаю cap deploy
, он дает эту ошибку
servers: [<server ip>]
[<server ip>] executing command
** [<server ip> :: out] Permission denied (publickey).
** [<server ip> :: out]
** [<server ip> :: out] fatal: Could not read from remote repository.
** [<server ip> :: out]
** [<server ip> :: out]
** [<server ip> :: out] Please make sure you have the correct access rights
** [<server ip> :: out]
** [<server ip> :: out] and the repository exists.
** [<server ip> :: out]
Вот мой deploy.rb
файл
set :scm, "git"
set :repository, "[email protected]:<user name>/<project name>.git"
set :branch, "master"
Если я clone
отправлю репо на свой локальный компьютер, он будет работать нормально. Я просмотрел документацию Bitbucket, но до сих пор не могу понять, чего не хватает.
И мой ssh для Bitbucket работает:
ssh -T [email protected]
authenticated via a deploy key.
You can use git or hg to connect to Bitbucket. Shell access is disabled.
This deploy key has read access to the following repositories:
<repor name>
Нашел этот вопрос SO, но безуспешно.