我创建了一个 cap 文件来部署一个站点,除了没有创建符号链接之外,它一切正常,我最近格式化了我的计算机,所以语法可能已经改变,我不确定。
namespace :myproject do
task :symlink, :roles => :app do
run "ln -nfs #{shared_path}/site_files/apache_password/.htaccess #{release_path}/src/public"
run "ln -nfs #{shared_path}/site_files/tmp #{release_path}/src/private/app/tmp"
run "ln -nfs #{shared_path}/site_files/media #{release_path}/src/public/media"
run "ln -nfs #{shared_path}/site_files/Config/database.php #{release_path}/src/private/app/Config/database.php"
run "ln -nfs #{shared_path}/site_files/Config/core.php #{release_path}/src/private/app/Config/core.php"
end
end
after "deploy:symlink", "myproject:symlink"
终端响应:
* 2012-10-29 11:27:10 executing `deploy:symlink'
* executing "rm -f /var/www/SITENAME/current && ln -s /var/www/SITENAME/releases/20121029112219 /var/www/SITENAME/current"
servers: ["SERVERNAME"]
[SERVERNAME] executing command
command finished in 74ms