Sha256: 9547e7d98a8c171d040a58cde19e6ac82ebaf3569644dafa016e6c2ee4d56196

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

namespace :s3_archive do

  def strategy
    @strategy ||= Capistrano::S3Archive::SCM.new(self, fetch(:s3_archive_strategy, Capistrano::S3Archive::SCM::RsyncStrategy))
  end

  desc 'Check that the S3 buckets are reachable'
  task :check  do
    run_locally do
      strategy.local_check
    end
    on release_roles :all do
      strategy.check
    end
  end

  desc 'Extruct and stage the S3 archive in a stage directory'
  task :stage do
    run_locally do
      if fetch(:skip_staging, false)
        info "Skip extructing and staging."
      else
        strategy.stage
      end
    end
  end

  after :stage, :cleanup do
    run_locally do
      strategy.cleanup
    end
  end

  desc 'Copy repo to releases'
  task :create_release => :stage do
    on release_roles :all do |server|
      execute :mkdir, '-p', release_path
      strategy.release(server)
    end
  end

  desc 'Determine the revision that will be deployed'
  task :set_current_revision do
    set :current_revision, strategy.current_revision
  end
end unless Rake::Task.task_defined?("s3_archive:check")

task :deploy_only do
  set :skip_staging, true
  invoke :deploy
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-s3_archive-0.4.5 lib/capistrano/tasks/s3_archive.rake