Capifony interactive branch tag deploy
If you want to deploy a specific tag using capifony (capistrano) you can specify it on your deploy.rb
set :branch, {branch}
or you can tell capistrano to ask it to you simply adding this lines to you capistrano script ( or in your Capfile ):
set :branch do
default_tag = `git tag`.split("\n").last
tag = Capistrano::CLI.ui.ask "Tag to deploy (make sure to push the tag first): [#{default_tag}] "
tag = default_tag if tag.empty?
tag
end
This way you are overriding the method set :branch with your own code. Here we're using git tag to fetch the last tag and use as default in case you don't specify a tag on your command line.
Smart and useful! ;)
Written by pleone
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Branch
Authors

niklongstone
42.01K

muzzlefork
11.98K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#