How to deploy a specific revision with capistrano

2019-03-15 08:26发布

问题:

How can I deploy a specific git revision with Capistrano 3?

The Capistrano 2.9 approach doesn't work anymore

$cap -S revision=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy
invalid option: -S

回答1:

The parameter seems to be gone in Capistrano 3. You have to set the env variable REVISION="revision" and include it in your deploy.rb

set :branch, ENV["REVISION"] || ENV["BRANCH_NAME"]