Sha256: dac4c1a7e185b970660f5acc80f7009f747c29059771ebd26ecc59edc6c7a175

Contents?: true

Size: 927 Bytes

Versions: 9

Compression:

Stored size: 927 Bytes

Contents

# frozen_string_literal: true

namespace :backup do
  namespace :storage do
    include Capistrano::Ops::Backup::Helper
    # Default to :app role
    rake_roles = fetch(:rake_roles, :app)
    desc 'pull latest storage dump from server to local'
    task :pull do
      on roles(rake_roles) do
        puts 'Creating temporary backup...'
        execute "#{prepare_env} BACKUPS_ENABLED=true EXTERNAL_BACKUP_ENABLED=false bundle exec rake storage:backup"
        puts 'Backup created'
        backup_file = backup_file_name('storage')
        backup_size = backup_file_size

        puts 'Prepare download...'

        question("Backup size: #{size_str(backup_size.to_i)}. Continue?", 'n') do |answer|
          if answer
            download_backup(backup_file, 'storage')
          else
            cleanup_backup(backup_file, "Aborting...\nDeleting temporary backup...")
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
capistrano-ops-1.0.8 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.7 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.6 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.5 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.4 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.3 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.2 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.1 lib/capistrano/ops/backup/tasks/storage/pull.rake
capistrano-ops-1.0.0 lib/capistrano/ops/backup/tasks/storage/pull.rake