我在deploy {.db文件中有以下内容,我从this tutorial获取,除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
答案 0 :(得分:3)
在当前的Capistrano版本中,默认任务deploy:symlink
已弃用,已被deploy:create_symlink
要使其有效,请将最后一行更改为:
after "deploy:create_symlink", "myproject:symlink"
见capistrano/recipes/deploy.rb line 294 and following。您应该在Capistrano输出中看到过弃用警告。为了使Capistrano输出更具可读性,我强烈推荐capistrano_colors gem。
答案 1 :(得分:0)
我遇到了完全相同的问题,经过一些拔毛后,我发现我的问题出在了railsless-deploy gem上。将其更新到1.1.0版本使一切正常。