I keep multiple branches in my git repository, and none of the ones
cap would be interested are the active branch. As a result, after the
git clone, the branch I have definied in my deploy.rb can't actually
be checked out.
My solution to this is to change lib/capistrano/recipes/deploy/scm/
git.rb , altering the line
execute += "cd #{destination} && #{git} checkout -b deploy
#{branch}"
to
execute += "cd #{destination} && "
execute += "#{git} branch -a && "
execute += "#{git} checkout -b deploy #{branch}"
which allows me to use
set :repository, "/var/www/v3/git-#{application}"
if ENV['DEPLOY'] == 'PRODUCTION'
puts "*** Deploying to the \033[1;41m PRODUCTION \033[0m
servers!"
set :branch, "origin/production"
else
puts "*** Deploying to the \033[1;42m STAGING \033[0m server!"
set :branch, "origin/staging"
end
in my deploy.rb .
I'm fairly new to git, and not intimately familiar with capistrano,
but this works for me. It might be useful for someone else.
- Scott
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---