Sha256: e851324cd0b9fdfa52628822e97b593523f1511e18cf029239190b241b7c8886

Contents?: true

Size: 944 Bytes

Versions: 11

Compression:

Stored size: 944 Bytes

Contents

# frozen_string_literal: true

require_relative '../backup_helper'
namespace :backup do
  namespace :storage do
    include BackupHelper
    # 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

11 entries across 11 versions & 1 rubygems

Version Path
capistrano-ops-0.2.14 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.13 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.12 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.11 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.10 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.9 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.8 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.7 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.6 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.5 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake
capistrano-ops-0.2.4 lib/capistrano/ops/capistrano/v3/tasks/backup/storage/pull.rake