Created
August 20, 2012 13:12
-
-
Save inkdeep/3403872 to your computer and use it in GitHub Desktop.
Capistrano select branch/tag to deploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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