Amazon EC2, deployment with capistrano, how?

I am trying to deploy an application to Amazon EC2 with capistrano.

When I run cap deploy:cold

or cap deploy

, I get:

  * 2014-08-27 13:23:39 executing `deploy:cold'
  * 2014-08-27 13:23:39 executing `deploy:update'
 ** transaction: start
  * 2014-08-27 13:23:39 executing `deploy:update_code'
    executing locally: "git ls-remote git@bitbucket.org:username/repository.git HEAD"
    command finished in 1929ms
  * executing "git clone -q git@bitbucket.org:username/repository.git /var/www/repository/releases/20140827112340 && cd /var/www/repository/releases/20140827112340 && git checkout -q -b deploy 813ea45938eca0ee8bae9663d66592b917ecf4fb && (echo 813ea45938eca0ee8bae9663d66592b917ecf4fb > /var/www/repository/releases/20140827112340/REVISION)"
    servers: ["54.XX.XX.XX"]
    [54.XX.XX.XX] executing command
 ** [54.XX.XX.XX :: err] Permission denied (publickey).
 ** [54.XX.XX.XX :: err] fatal: Could not read from remote repository.
 ** 
 ** Please make sure you have the correct access rights
 ** and the repository exists.
    command finished in 505ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /var/www/repository/releases/20140827112340; true"
    servers: ["54.XX.XX.XX"]
    [54.XX.XX.XX] executing command
    command finished in 246ms
failed: "sh -c 'git clone -q git@bitbucket.org:username/repository.git /var/www/repository/releases/20140827112340 && cd /var/www/repository/releases/20140827112340 && git checkout -q -b deploy 813ea45938eca0ee8bae9663d66592b917ecf4fb && (echo 813ea45938eca0ee8bae9663d66592b917ecf4fb > /var/www/repository/releases/20140827112340/REVISION)'" on 54.XX.XX.XX

      

My deploy.rb

file:

set :application, "appname"

set :scm, :git
set :repository, "git@bitbucket.org:username/repository.git"

set :user, "ubuntu"
set :deploy_to, "/var/www/repository"

server "54.XX.XX.XX", :app, :primary => true

      

I followed this tutorial .

I added an SSH key on the remote machine and put it in the git ssh keys.

I have write access to this repository.

How to fix it?

thank

+3
git ruby-on-rails ssh amazon-web-services amazon-ec2


source to share


No one has answered this question yet

Check out similar questions:

20142
How do I undo the last local commits in Git?
15981
How do I delete a Git branch locally and remotely?
8423
How do I undo 'git add' before committing?
7919
How do I rename my local Git branch?
7672
How do I modify existing messages without committing?
7159
How do I revert the Git repository to a previous commit?
6484
How do I force "git pull" to overwrite local files?
6475
How to remove local (untracked) files from the current Git working tree
6334
How do I checkout a remote Git branch?
4491
How to discard unstated changes in Git?



All Articles
Loading...
X
Show
Funny
Dev
Pics