缓存副本上的capistrano错误

时间:2009-12-06 21:30:17

标签: capistrano

运行上限部署时,我收到以下错误:更新

失败:“sh -c”if [-d / home / deployer / apps / all_bout_texas / shared / cached-copy];然后cd / home / deployer / apps / all_bout_texas / shared / cached-copy&& git fetch -q origin&& git reset -q --hard 2350e98662e7fe00d526ff5f69460beb868a978a&& git clean -q -d -x -f;否则git clone -q --depth 1 git@github.com:jpowell / all_bout_texas .git / home / deployer / apps / all_bout_texas / shared / cached-copy&& cd / home / deployer / apps / all_bout_texas / shared / cached-copy&& git checkout -q -b deploy 2350e98662e7fe00d526ff5f69460beb868a978a; fi' “

这是我的deploy.rb:

set :application, "all_bout_texas"

# 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/deployer/apps/#{application}"

# If you aren't using Subversion to manage your source code, specify
# your SCM below:

default_run_options[ty] = true

set :scm, :git

set :repository, "git@github.com:jpowell/all_bout_texas.git"

set :deploy_via, :remote_cache

set :branch, "master"

set :git_shallow_clone, 1

set :copy_cache, true


# abt

role :app, "174.143.241.236"

role :web, "174.143.241.236"

role :db, "174.143.241.236", rimary => true


set :scm_username, "my_user"

set :scm_passphrase, "my_pass"

set :scm_verbose, false


set :user, "my_user"

set :runner, "my_user"


namespace :deploy do

task :copy_database_configuration do

production_db_config = "/home/deployer/config/abt_database.yml"

run "cp #{production_db_config} #{release_path}/config/database.yml"

end


desc "Restarting mod_rails with restart.txt"

task :restart, :roles => :app, :except => { :no_release => true } do

run "touch #{current_path}/tmp/restart.txt"

end


[:start, :stop].each do |t|

desc "#{t} task is a no-op with mod_rails"

task t, :roles => :app do ; end

end


after "deploy:update_code", "deploy:copy_database_configuration"

after "deploy:update_code", "deploy:restart"


end

有什么想法吗?感谢。

约什

2 个答案:

答案 0 :(得分:1)

交叉张贴是不好品味Josh;你有浪费两个社区时间的风险,至少有礼貌告诉一个,你贴到了另一个社区。

您需要验证(正如我在Google列表中发布的那样)您的部署无需使用:remote_cache。

答案 1 :(得分:1)

您好,我今天在尝试从github私人仓库部署时遇到此错误。我能够通过未知的repository_cache选项指定我想要使用的缓存目录的名称并使用下划线而不是连字符来修复它:

set :repository_cache, "cached_copy"

如果您查看Capistrano Github repo for the remote_cache strategy,那么您会看到它将repository_cache设置为'cached-copy'

我创建了一个issue in the Capistrano Github project,以防来自社区的任何活动。