Skip to content

Instantly share code, notes, and snippets.

@inkdeep
Created August 20, 2012 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inkdeep/3403872 to your computer and use it in GitHub Desktop.
Save inkdeep/3403872 to your computer and use it in GitHub Desktop.
Capistrano select branch/tag to deploy
set :branch do
tags = `git tag`.split("\n")
list = tags.collect {|x| %(#{tags.index(x)}: #{x}) }
puts %(------------------------------------------
Available Tags for Deployment
Use m for master
------------------------------------------)
puts list << "------------------------------------------\n"
i = Capistrano::CLI.ui.ask('Tag to deploy:')
i == 'm' ? 'master' : tags[i.to_i]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment