【问题标题】:Capistano deploy:update fails at git cloneCapistrano 部署:更新在 git clone 失败
【发布时间】:2012-05-18 16:59:12
【问题描述】:

我正在尝试使用 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

部署.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

【问题讨论】:

  • 日志显示部署失败时发生了什么?

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


【解决方案1】:

问题出在我的根上 ubuntu 无权访问根文件

【讨论】:

    猜你喜欢
    • 2016-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多