你的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
,您可以添加到重新定義默認任務爲好。