Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created February 17, 2011 16:10
Show Gist options
  • Save diasjorge/832007 to your computer and use it in GitHub Desktop.
Save diasjorge/832007 to your computer and use it in GitHub Desktop.
namespace :db do
desc "Download DB dump"
task :pull, :roles => :db, :once => true do
Capistrano::CLI.ui.say("You are about to import the DB from the #{stage} server")
agree = Capistrano::CLI.ui.agree("Continue (Yes, [No]) ") do |q|
q.default = 'n'
end
exit unless agree
deploy.clear_cache
run "cd #{current_release}; #{drush_cmd} sql-dump > /tmp/dump.sql"
download("/tmp/dump.sql", "/tmp/dump.sql")
system "drush -y sql-drop"
system "drush sql-cli < /tmp/dump.sql"
end
end
namespace :deploy do
namespace :files do
task :pull do
puts "PENDING"
# rsync -avz kommerling-dev:deployment/kommerling/shared/files/ sites/default/files
# download("#{shared_path}/files", "sites/default/files/")
end
end
end
namespace :git do
desc "Tag current commit after deploy"
task :tag do
system "git tag -a -m 'tagging current code for deployment to staging' rel-#{release_name}"
end
end
after "deploy:symlink", "git:tag"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment