diff --git a/app/config/deploy.rb b/app/config/deploy.rb index fcda084..1c6f90d 100644 --- a/app/config/deploy.rb +++ b/app/config/deploy.rb @@ -22,4 +22,23 @@ # logger.level = Logger::MAX_LEVEL default_run_options[:pty] = true -set :use_sudo, false \ No newline at end of file +set :use_sudo, false + +# Deploy from tags +namespace :deploy do + + desc "Deply to a tag" + task :tag do + transaction do + 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 unless exists?(:branch) + + find_and_execute_task("deploy") + end + end +end \ No newline at end of file