tags:

views:

48

answers:

1

I am using capistrano to deploy a ruby on rails project. I am attempting to login to remote server as user 'deploy' and deploy this application.

When I ssh into box as deploy and git clone the project it works

ssh deploy@remote_box
git clone [email protected]:lumdum/demo.git 

However when I run using capistrano it says that permission denied to account dorelal. dorelal is my account on github. So I thought capistrano is executing the task locally on my mac and not on my remote server which is on redhat.

And that is true that capistrano is running locally the command. when I execute

cap staging deploy -vvvv

this is the error message I am getting

executing locally: "git ls-remote [email protected]:lumdum/demo.git master"

Notice it says 'executing locally'. Why is capistrano running it locally and not on my remote box.

here is my deploy.rb

set :stages, %w(staging)
require 'capistrano/ext/multistage'

set :repository,  "[email protected]:lumdum/demo.git"
set :scm, :git
set :user, 'deploy'
set :use_sudo, false
set :keep_releases, 2

role :web, "serv1"                 
role :app, "serv1" 
role :db,  "db1", :primary => true 

set :application, "demo_staging"
set :branch, "master"
set :deploy_via, :remote_cache
set :deploy_to, "/var/www/rails/demo"
set :scm_user, 'dorelal_lumdum'
set :user, 'deploy'

set :rails_env, "staging"
set :keep_releases, 1
+2  A: 

Capistrano runs that locally to determine the HEAD on the repository, which is then used in the subsequent step to check-out (or, clone in Git terminology) the precise revision that was seen from your workstation.

I'll admit this is a little unexpected!

Beaks
thanks. Not sure why it has to checkout locally to find out HEAD but I'm sure they have a good reason. It would be nice if it is documented :-)
Nadal