你的git工作流程非常标准,你不会简化它很多。我想,你不需要推动每个提交,并且许多小的原子提交没有任何问题。
尽管如此,为什么每次都要运行设置和清理?你不能只跑cap deploy
?如果您每次需要运行cleanup
,请尝试重新定义deploy
的默认值以包含它。在您的deploy.rb
:
namespace :deploy do
desc <<-DESC
Deploys your project. This calls both `update' and `restart'. Note that \
this will generally only work for applications that have already been deployed \
once. For a "cold" deploy, you'll want to take a look at the `deploy:cold' \
task, which handles the cold start specifically.
DESC
task :default do
update
restart
cleanup # <-- this is added
end
end
如果你有一个很好的理由,每次运行setup
,您可以添加到重新定义默认任务为好。