Instantly share code, notes, and snippets.

Embed
What would you like to do?
Capistrano Deployment By Semantic Version Tag In Git https://ryanburnette.com/blog/capistrano-deployment-by-tag
# deploy.rb
set :branch, Proc.new {
tags = `git tag`.split("\n")
vers = {}
tags.each do |t|
v = t.gsub('v','')
vers[v] = t
end
sorted_vers = vers.keys.sort { |x,y| Gem::Version.new(x) <=> Gem::Version.new(y) }
vers[sorted_vers.last]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment