Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created August 5, 2009 02:30
Show Gist options
  • Save defunkt/162444 to your computer and use it in GitHub Desktop.
Save defunkt/162444 to your computer and use it in GitHub Desktop.
# you'd obviously have more settings somewhere
set :repository, "[email protected]: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