I am wondering how I can target a specific commit SHA in Git for deployment, using Capistrano? It should be something like
cap deploy --version=<sha targeted>
Can't seem to find the answer to this after a lot of searching.
I am wondering how I can target a specific commit SHA in Git for deployment, using Capistrano? It should be something like
cap deploy --version=<sha targeted>
Can't seem to find the answer to this after a lot of searching.
Prompts for input but defaults to 'master' if you press return.
For Capistrano 2.9 until 3.0:
For older versions of Capistrano, you can deploy a particular git commit/tree/branch/tag by doing this:
In some cases there may be a need of specifying the Environment as an argument as well.
production
is just an example.molf's answer didn't work for me (using capistrano 2.11.2). I had to use "revision" instead of branch, like this:
Capistrano 3
In your
deploy.rb
or stage-specific file likeconfig/deploy/production.rb
This allows you to point to a specific git revision. It accepts a SHA but also anything that resolves to a real revision (e.g. git tag, annotated tag, or branch).
Use it on the command line by setting the
REVISION
environment variable, e.g.