Rails, Git, Capistrano


Hopefully someone here can help me out as Dreamhost could not due to policy reasons…

Webdav, git, and Capistrano are all new to me. Despite that, I have successfully managed to set it all up, and it is working quite well as long as my repository IS NOT password protected.

When I enable password protection, git works well. I can push and pull from my local machine with no problems. When I try to deploy with Capistrano, I run into the following error:

** [willie.dreamhost.com :: err] Cannot get remote repository information.
** Perhaps git-update-server-info needs to be run there?
command finished
*** [deploy:update_code] rolling back

  • executing "rm -rf /home/astjohn/jen_designs/releases/20080905021521; true"
    servers: [“willie.dreamhost.com”]
    [astjohn@willie.dreamhost.com] executing command
    command finished
    failed: “sh -c “if [ -d /home/astjohn/jen_designs/shared/cached-copy ]; then cd /home/astjohn/jen_designs/shared/cached-copy && git fetch -q origin && git reset -q --hard 892398215e29e12b445ef7e25f882a8990afa257; else git clone -q http://www.astjohn.ca/git/JenDesigns/ /home/astjohn/jen_designs/shared/cached-copy && cd /home/astjohn/jen_designs/shared/cached-copy && git checkout -q -b deploy 892398215e29e12b445ef7e25f882a8990afa257; fi”” on astjohn@willie.dreamhost.com

When I run (on dreamhost server):

clone -q http://www.astjohn.ca/git/JenDesigns/ testing/

I receive the same “Cannot get remote… etc…” error.

I would really like to password protect my git repo.
Any help would be appreciated.

Here is my deploy.rb file for capistrano:

Help from http://www.glennfu.com/2008/02/01/deploying-ruby-on-rails-with-capistrano-on-dre amhost/

The host where people will access my site

set :application, "jen_designs"
set :user, “astjohn” #my dreamhost username set to access this project
set :admin_login, “astjohn” #my admin login name

If you aren’t deploying to /u/apps/#{application} on the target

servers (which is the default), you can specify the actual location

via the :deploy_to variable:

set :deploy_to, “/home/#{admin_login}/#{application}”

My DreamHost-assigned server

set :domain, "#{admin_login}@willie.dreamhost.com"
role :app, domain
role :web, domain
role :db, domain, :primary => true

desc "Link shared files"
task :before_symlink do
run "rm -drf #{release_path}/public/bin"
run "ln -s #{shared_path}/bin #{release_path}/public/bin"

set :use_sudo, false # capistrano will default to use sudo
set :checkout, “export”

If you aren’t using Subversion to manage your source code, specify

your SCM below:

set :scm, :git
set :repository, "http://www.astjohn.ca/git/JenDesigns/"
set :scm_username, 'astjohn’
set :scm_password, ‘XXXXX’
#set :branch, "master"
set :deploy_via, :remote_cache

I used the handy quick tool to set up an SVN repository on DreamHost and this is where it lives

#set :svn, “/usr/bin/svn”
#set :svn_user, ‘my svn username’
#set :svn_password, ‘my svn password’
#set :repository,

Proc.new { "–username #{svn_user} " +

"–password #{svn_password} " +

http://svn.gamelizard.com/rgamelizard/trunk/” }

copy server config files after deployment

task :update_config, :roles => [:app] do
run "cp -Rf #{shared_path}/config/* #{release_path}/config/"
after ‘deploy:update_code’, :update_config

desc "Restarting after deployment"
task :after_deploy, :roles => [:app, :db, :web] do
run “touch #{deploy_to}/current/public/dispatch.fcgi”

force ‘production’ environment during deployment

run "sed ‘s/# ENV\[/ENV\[/g’ #{deploy_to}/current/config/environment.rb > #{deploy_to}/current/config/environment.temp"
run "mv #{deploy_to}/current/config/environment.temp #{deploy_to}/current/config/environment.rb"

desc "Restarting after rollback"
task :after_rollback, :roles => [:app, :db, :web] do
run "touch #{deploy_to}/current/public/dispatch.fcgi"


Far as I know git is not running on dh… so you can’t push to DH… but I maybe wrong :smiley:

Somewhere, something incredible is waiting to be known.