Created
February 17, 2011 16:10
-
-
Save diasjorge/832007 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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