3

我从本教程中获取的 deploy.rb 文件中有以下内容,除了命令之外,一切都完全正常touch

有谁知道为什么这可能不起作用?

set :application, "your-application-name"
set :repository, "git@github.com:you/your-project.git"
set :scm, :git
set :deploy_to, "/home/path/to/project/"
set :use_sudo, false

set :deploy_via, :remote_cache
set :copy_exclude, [".git", ".DS_Store", ".gitignore", ".gitmodules"]

server "example.org", :app

namespace :myproject do
    task :symlink, :roles => :app do
        run "ln -nfs #{shared_path}/uploads #{release_path}/application/wp-content/uploads"
        run "touch #{release_path}/env_production"
    end
end

after "deploy:create_symlink", ":after_deploy" 

上限部署的输出

 * executing `deploy'
 * executing `deploy:update'
** transaction: start
 * executing `deploy:update_code'
   updating the cached checkout on all servers
   executing locally: "git ls-remote git@github.com:jeffreynolte/Testing-WP-Workflow.git HEAD"
 * executing "if [ -d /var/www/domain.com/subdomains/wp-workflow/shared/cached-copy ]; then cd /var/www/domain.com/subdomains/wp-workflow/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 8c10e1f459dc78a127681362386bb84d5fbf3662 && git clean -q -d -x -f; else git clone -q git@github.com:jeffreynolte/Testing-WP-Workflow.git /var/www/domain.com/subdomains/wp-workflow/shared/cached-copy && cd /var/www/domain.com/subdomains/wp-workflow/shared/cached-copy && git checkout -q -b deploy 8c10e1f459dc78a127681362386bb84d5fbf3662; fi"
   servers: ["domain.com"]
   [domain.com] executing command
   command finished in 3905ms
   copying the cached version to /var/www/domain.com/subdomains/wp-workflow/releases/20121026041737
 * executing "rsync -lrpt --exclude=\".git\" --exclude=\".DS_Store\" --exclude=\".gitignore\" --exclude=\".gitmodules\" /var/www/domain.com/subdomains/wp-workflow/shared/cached-copy/ /var/www/domain.com/subdomains/wp-workflow/releases/20121026041737 && (echo 8c10e1f459dc78a127681362386bb84d5fbf3662 > /var/www/domain.com/subdomains/wp-workflow/releases/20121026041737/REVISION)"
   servers: ["domain.com"]
   [domain.com] executing command
   command finished in 577ms
 * executing `deploy:finalize_update'
 * executing "chmod -R g+w /var/www/domain.com/subdomains/wp-workflow/releases/20121026041737"
   servers: ["domain.com"]
   [domain.com] executing command
   command finished in 51ms
 * executing `deploy:symlink'
 * executing "rm -f /var/www/domain.com/subdomains/wp-workflow/current && ln -s /var/www/domain.com/subdomains/wp-workflow/releases/20121026041737 /var/www/domain.com/subdomains/wp-workflow/current"
   servers: ["domain.com"]
   [domain.com] executing command
   command finished in 45ms
** transaction: commit
4

2 回答 2

3

在当前 Capistrano 版本中,默认任务deploy:symlink已被弃用,并已被替换为deploy:create_symlink

要使其工作,请将最后一行更改为:

after "deploy:create_symlink", "myproject:symlink"

请参阅capistrano/recipes/deploy.rb 第 294 行及以下。您应该已经在 Capistrano 输出中看到了弃用警告。为了使 Capistrano 输出更具可读性,我强烈推荐capistrano_colors gem

于 2012-10-24T15:48:12.747 回答
0

我遇到了完全相同的问题,经过一番拉扯后,我认为我的问题出在 railsless-deploy gem 上。将其更新到 1.1.0 版本后一切正常。

于 2013-05-24T16:16:18.467 回答