I’m trying to get a Capistrano deployment script working, in my deploy file i have the following…
set :application, "example.com"
role :app, "root@12.34.56.789"
role :web, "root@12.34.56.789"
role :db, "root@12.34.56.789", :primary => true
set :user, "root"
set :deploy_to, "/example/www/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :keep_releases, 10
namespace :deploy do
desc "Tell Passenger to restart the app."
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
desc "Symlink shared configs and folders on each release."
task :symlink_shared do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
end
desc "Sync the public/assets directory."
task :assets do
system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{application}:#{shared_path}/"
end
end
after 'deploy:update_code', 'deploy:symlink_shared'
Also i have a github location and scm variable in the deploy file. When I run cap deploy it starts off ok, asks for a username/password for github private repo, i enter that, its fine. Then after that succeeds and pulls the code correctly I get the folllowing…
executing “if [ -d /example/www/example.com/shared/cached-copy ];
then cd /example/www/example.com/shared/cached-copy && git fetch -q
origin && git fetch –tags -q origin && git reset -q –hard
93e3432103327f29a9e66fa2755562bfe9bc4412 && git clean -q -d -x -f;
else git clone -q https://github.com/example/example.git
/example/www/social u.com/shared/cached-copy && cd
/example/www/example.com/shared/cached-copy && git checkout -q -b
deploy 93e3432103327f29a9e66fa2755562bfe9bc4412; fi”
servers: [“12.34.56.789”] Password:
So it asks for a password. I’m guessing this is for ssh. I enter the password for the root user, but then it fails displaying this…
[12.34.56.789] executing command
** [12.34.56.789 :: err] Username:
I tried also not entering a password at all and I get the following….
Capistrano::ConnectionError, connection failed
(Net::SSH::AuthenticationFailed: root)
The catch is I am entering the right ssh password… I can ssh in fine using putty. Btw I am running cap deploy on my local windows pc, and the remote box is a linux box. Of course my location is not 12.34.56.78 but you get the point. Any ideas on how to resolve?
You need to be using the SSH url for GitHub, not the https one.