From ae7bbc33a1f30bd4c24fe22979a7dbf57dd112fc Mon Sep 17 00:00:00 2001 From: Trey Dempsey Date: Wed, 26 Jun 2013 18:44:20 -0500 Subject: [PATCH] Honor capistrano-ext/multistage stages. --- lib/capistrano/deployflow.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/capistrano/deployflow.rb b/lib/capistrano/deployflow.rb index 0a8c1da..bdbb900 100644 --- a/lib/capistrano/deployflow.rb +++ b/lib/capistrano/deployflow.rb @@ -28,8 +28,8 @@ def ask_which_tag desc "Set the tag to deploy to the selected stage." task :set_deploy_codebase do - abort "Unsupported stage: #{stage}." unless [:staging, :production].include?(stage) - if stage == :staging + abort "Unsupported stage: #{stage}." unless stages.include?(stage.to_s) + if stage.to_s.match(/^staging/) # Ask which tag to deploy tag_to_deploy = ask_which_tag # Push to origin staging @@ -37,7 +37,7 @@ def ask_which_tag abort "Git push failed!" if $? != 0 # Set deploy codebase to our tag set :branch, tag_to_deploy - elsif stage == :production + elsif stage.to_s.match(/^production/) tag_to_deploy = ask_which_tag # Switch to 'master' system "git checkout master" @@ -53,7 +53,6 @@ def ask_which_tag puts "*** Could not switch back to 'develop' branch! Be sure to manually switch before continuing work." if $? != 0 set :branch, tag_to_deploy end - end task :verify_up_to_date do