Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I target a specific commit SHA with capistrano deploy

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.

like image 544
Scott Miller Avatar asked May 27 '09 21:05

Scott Miller


2 Answers

For Capistrano 2.9 until 3.0:

cap -S revision=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy 

For older versions of Capistrano, you can deploy a particular git commit/tree/branch/tag by doing this:

cap -s branch=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy 

In some cases there may be a need of specifying the Environment as an argument as well. production is just an example.

cap production -S revision=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy 
like image 165
molf Avatar answered Sep 21 '22 08:09

molf


molf's answer didn't work for me (using capistrano 2.11.2). I had to use "revision" instead of branch, like this:

cap -S revision=80655da8d80aaaf92ce5357e7828dc09adb00993 deploy 
like image 36
eahanson Avatar answered Sep 22 '22 08:09

eahanson