Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ you have to do is `cap production deploy`, and deployflow will ask which tag you
your most recent automatically), merge that tag over to your master branch, push to origin, and deploy that tag
to production.

For non-interactive deployments you can also specify the tag with tag="tag name". For example you can do
`cap production deploy tag=production_20130626`.

Credits
-------

Expand Down
14 changes: 8 additions & 6 deletions lib/capistrano/deployflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ def most_recent_tag
end

def ask_which_tag
tag = Capistrano::CLI.ui.ask("What tag would you like to promote to #{stage}? [#{most_recent_tag}]")
if tag == ""
promote_tag = most_recent_tag
if ENV['tag']
promote_tag = ENV['tag']
else
# Do we have this tag?
abort "Tag '#{tag}' does not exist!" unless `git tag`.split(/\n/).include?(tag)
promote_tag = tag
tag = Capistrano::CLI.ui.ask("What tag would you like to promote to #{stage}? [#{most_recent_tag}]")
promote_tag = tag == "" ? most_recent_tag : tag
end

# Do we have this tag?
abort "Tag '#{promote_tag}' does not exist!" unless `git tag`.split(/\n/).include?(promote_tag)

puts "Promoting #{promote_tag} to #{stage}."
return promote_tag
end
Expand Down