Capistrano部署:git clone更新失败

时间:2012-05-18 16:59:12

标签: ruby-on-rails ruby git amazon-web-services capistrano

我正在尝试使用Capistrano部署更新,我收到以下错误。为什么会失败?我之前已部署到此服务器。我已经包含了我的deploy.rb文件。

failed: "sh -c 'git clone -q --depth 1 git@github.com:username/sample_app.git /var/www    
/apps/sample_app/releases/20120518162414 && cd /var/www/apps/sample_app/releases/20120518162414 &&
git checkout -q -b deploy 1eac914d3b04039b8286416f51b4f223b626b267 && (echo 
1eac914d3b04039b8286416f51b4f223b626b267 > /var/www/apps/sample_app/releases/20120518162414   
/REVISION)'" on server.domain.com

deploy.rb

# The name of your app
set :application, "sample_app"

# The directory on the EC2 node that will be deployed to
set :deploy_to, "/var/www/apps/#{application}"

set :keep_releases, 3

# deploy with git
set :scm, :git
set :repository,  "git@github.com:username/sample_app.git"
set :git_shallow_clone, 1
set :branch, "master"
set :use_sudo, true

set :user, "ubuntu"
ssh_options[:keys] = ["/ServerKeys/key.pem"]
ssh_options[:forward_agent] = true
default_run_options[:pty] = true

# The address of the remote host on EC2 (the Public DNS address)
set :location, "server.domain.com"

# setup some Capistrano roles
role :app, location
role :web, location
role :db,  location, :primary => true

after 'deploy:update_code', 'deploy:symlink_db'

namespace :deploy do

 desc "Restart Application"
 task :restart, :roles => :app do
 run "touch #{deploy_to}/#{shared_dir}/tmp/restart.txt"
 end

 desc "Symlinks the database.yml"
 task :symlink_db, :roles => :app do
 run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
 end

end

1 个答案:

答案 0 :(得分:1)

问题在于它归root所有 ubuntu无权访问根文件

相关问题