capistrano initial deployment
- by Richard G
I'm trying to set up Capistrano to deploy to an AWS box. This is the first time I've tried to set this up, so please bear with me.
Could someone take a look at this and let me know if you can solve this error? The output below is the deploy.rb file, and it's output when it runs.
set :application, "apparel1"
set :repository, "git://github.com/rgilling/GroceryRun.git"
set :scm, :git
set :user, "ubuntu"
set :scm_passphrase, "pre5ence"
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
ssh_options[:keys] = ["/Users/rgilling/Documents/Projects/Apparel1/abesakey.pem"]
ssh_options[:forward_agent] = true
set :location, "ec2-107-22-27-42.compute-1.amazonaws.com"
role :web, location # Your HTTP server, Apache/etc
role :app, location # This may be the same as your `Web` server
role :db, location, :primary => true # This is where Rails migrations will run
set :deploy_to, "/var/www/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, true
# if you want to clean up old releases on each deploy uncomment this:
# after "deploy:restart", "deploy:cleanup"
# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
Then the execution results in this permission error. I think I"ve set up the SSH etc. correctly...
updating the cached checkout on all servers
executing locally: "git ls-remote git://github.com/rgilling/GroceryRun.git HEAD"
command finished in 1294ms
* executing "if [ -d /var/www/apparel1/shared/cached-copy ]; then cd /var/www/apparel1/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard f35dc5868b52649eea86816d536d5db8c915856e && git clean -q -d -x -f; else git clone -q git://github.com/rgilling/GroceryRun.git /var/www/apparel1/shared/cached-copy && cd /var/www/apparel1/shared/cached-copy && git checkout -q -b deploy f35dc5868b52649eea86816d536d5db8c915856e; fi"
servers: ["ec2-107-22-27-42.compute-1.amazonaws.com"]
[ec2-107-22-27-42.compute-1.amazonaws.com] executing command
** **[ec2-107-22-27-42.compute-1.amazonaws.com :: err] error: cannot open .git/FETCH_HEAD: Permission denied**