Skip to content

Instantly share code, notes, and snippets.

@ivar
Created November 3, 2010 22:03
Show Gist options
  • Save ivar/661805 to your computer and use it in GitHub Desktop.
Save ivar/661805 to your computer and use it in GitHub Desktop.
task :check_deployment_branch, :except => {:no_release => true, :no_symlink => true} do
if rails_env == 'production'
CLI.ui.say "================================\nDeploying to PRODUCTION.\n================================\n\n"
# CLI.ui.say "Current production branch is set to: #{repository}"
set :branch, "master"
set :continue, Proc.new {CLI.ui.ask "Do you wish to continue? [yes/NO]"}
raise Error, "Failing production deploy" unless continue == 'yes' || continue == 'y'
else
CLI.ui.say "================================\nDeploying to #{deploy_type.upcase}.\n================================\n\n"
set :new_branch, Proc.new { CLI.ui.ask "Please pick your branch or press ENTER for #{branch}."}
set :branch, new_branch unless "#{new_branch}".strip.empty?
%x(say -v Zarvox "Deployment of branch #{branch} to #{deploy_type} initiated." &)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment