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" 

cap 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_colorsgemを強くお勧めします。

于 2012-10-24T15:48:12.747 に答える