Sha256: 8cae38fc92bda41a77c16f9bd71f500d74df3375a240ae0fa1a7492eb561cc82
Contents?: true
Size: 1.08 KB
Versions: 3
Compression:
Stored size: 1.08 KB
Contents
namespace :pull do desc 'Pull data (db/files) from remote (i.e: production) application.' task :data do invoke "pull:files" invoke "pull:db" end desc 'Pull db' task :db do on roles(:app) do |host| debug ": Pulling database from #{fetch(:stage)} ..." within "#{current_path}/tmp" do with rails_env: :production do rake "db:backup" end end run_locally do execute "scp -P #{host.port} #{host.user}@#{host.hostname}:#{current_path}/tmp/db.sql tmp/" rake "db:restore tmp/db.sql" end end end desc 'Pull files uploaded' task :files do on roles(:app) do |host| run_locally do debug ": Pulling Files from #{fetch(:stage)} ..." if fetch(:backup_dirs).any? fetch(:backup_dirs).each do |dir| execute "rm -r #{dir}" execute "scp -r -P #{host.port} #{host.user}@#{host.hostname}:#{current_path}/#{dir} #{dir}" end else error ": Set key :backup_dirs to know which ones to pull" end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
prun-ops-0.0.19 | lib/capistrano/pull.rake |
prun-ops-0.0.18 | lib/capistrano/pull.rake |
prun-ops-0.0.17 | lib/capistrano/pull.rake |