Skip to content

Instantly share code, notes, and snippets.

@ozeias
Forked from defunkt/gist:162444
Created May 22, 2010 21:04
Show Gist options
  • Save ozeias/410359 to your computer and use it in GitHub Desktop.
Save ozeias/410359 to your computer and use it in GitHub Desktop.
# you'd obviously have more settings somewhere
set :repository, "git@github.com:defunkt/github.git"
set :branch, "origin/master"
namespace :deploy do
desc "Deploy the MFer"
task :default do
update
restart
cleanup
end
desc "Setup a GitHub-style deployment."
task :setup, :except => { :no_release => true } do
run "git clone #{repository} #{current_path}"
end
desc "Update the deployed code."
task :update_code, :except => { :no_release => true } do
run "cd #{current_path}; git fetch origin; git reset --hard #{branch}"
end
desc "Rollback a single commit."
task :rollback, :except => { :no_release => true } do
set :branch, "HEAD^"
default
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment