I'm trying to deploy my Rails app from Bitbucket to Digital Ocean. I'm using Git as my version control system, I have done the following:
pbcopy < ~/.ssh/id_rsa.pub
https://bitbucket.org/<account name>/<project admin/deploy-keys
)but when I run the cap deploy
it gives this error
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]
Here is my deploy.rb
file
set :scm, "git"
set :repository, "[email protected]:<user name>/<project name>.git"
set :branch, "master"
If I clone
the repo to my local, it works fine. I went through the Bitbucket docs, but still cannot figure out what is missing.
And my ssh to Bitbucket works:
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>
Found this SO question but without any luck.
OK, I found the solution, I will add it here so that someone might find it useful.
I fixed the problem my creating a SSH key in Digital Ocean and adding it to Bitbucket.
Following are the steps
https://bitbucket.org/<user>/<project>/admin/deploy-keys
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With