Permalink
Browse files

small fix for rollback

  • Loading branch information...
1 parent 1cf9814 commit d1455747f24674545f8cbac8767d5c65a5763321 @tobi committed Aug 24, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 config/deploy.rb
View
@@ -2,6 +2,7 @@
set :repository, "git://github.com/tobi/image_server.git"
set :branch, "origin/master"
set :user, 'deploy'
+set :deploy_type, 'deploy'
role :app, instance = ENV['INSTANCE'] || "vm"
@@ -20,15 +21,16 @@
desc "Update the deployed code."
task :update_code, :except => { :no_release => true } do
- run "cd #{current_path}; git fetch origin; git reset --hard #{branch}; git tag 'deploy-#{Time.now.to_i}'"
+ run "cd #{current_path}; git fetch origin; git reset --hard #{branch}; git tag '#{deploy_type}-#{Time.now.to_i}'"
end
namespace :rollback do
desc "Rollback a single commit."
task :default, :except => { :no_release => true } do
branch = capture("cd #{current_path}; git tag -l 'deploy*' | tail -n2 | head -n1")
+ set :deploy_type, 'rollback'
set :branch, branch
- default
+ deploy.default
end
end

0 comments on commit d145574

Please sign in to comment.