Skip to content
Open
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
7 changes: 3 additions & 4 deletions lib/capistrano/deployflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ 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
system "git push --tags origin staging"
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"
Expand All @@ -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
Expand Down