Module: TbRelease::Capistrano
- Includes:
- ReleaseVersion
- Defined in:
- lib/tb_release/capistrano.rb
Overview
Capistrano support. Allows setting Capistrano ‘branch’ variable to be set:
Example:
# deploy/staging.rb
set :branch do
get_release_version
end
If the variable ‘release_version’ exists (e.g. via cap –set-before release_version=v1.2.3’ …) the value is used as branch otherwise the user is ask for the branch (release_version).
Instance Method Summary collapse
Instance Method Details
#get_release_version ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/tb_release/capistrano.rb', line 22 def get_release_version unless exists?(:release_version) = available_release_versions puts "tags:\n#{.join("\n")}" default_tag = .last puts "consider to set tag via 'cap --set-before release_version=v1.2.3 ...'" tag = ::Capistrano::CLI.ui.ask "Tag to deploy (make sure to push the tag first): [#{default_tag}] " tag = default_tag if tag.empty? tag else release_version end end |