我已经创建了一个用于部署网站的上限文件,除了没有创建符号链接外,它都可以工作,我最近格式化了我的计算机,所以可能语法已经改变,我不确定。
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