【发布时间】:2015-10-08 20:45:50
【问题描述】:
我尝试在部署时创建具有完整提交哈希的 REVISION 文件。
#early..
revision = %x[git rev-parse HEAD]
set :revision, revision
namespace :assets do
task :install do
on roles :all do
puts fetch(:revision, "") #it's good, print ee51dc1308a07cb0dfadd60b2a9d1b3485614034
execute :sh, "-c 'echo #{fetch(:revision, "")} > #{release_path}/REVISION2'"
execute :sh, "-c 'cat #{release_path}/REVISION2'" #empty output
execute :php, "#{release_path}/public/index.php assetic build"
end
end
end
因此,我的文件 REVISION2 没有内容。
Capistrano 版本:3.4.0(Rake 版本:10.1.0) 开发机器:Ubuntu 14.04.2 LTS 部署到 CentOS 6.4 版(最终版)
【问题讨论】: