Sha256: 5a4305466eec08bca943555969b0c07aace5939c3b6b610fecd0374293cdc09b

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

namespace :load do
  task :defaults do
    Capistrano::S3::Defaults.populate(self, :set)
  end
end

namespace :deploy do
  namespace :s3 do
    desc "Empties bucket of all files. Caution when using this command, as it cannot be undone!"
    task :empty do
      Capistrano::S3::Publisher.clear!(fetch(:region), fetch(:access_key_id), fetch(:secret_access_key), fetch(:bucket))
    end

    desc "Waits until the last CloudFront invalidation batch is completed"
    task :wait_for_invalidation do
      Capistrano::S3::Publisher.check_invalidation(fetch(:region), fetch(:access_key_id), fetch(:secret_access_key), fetch(:distribution_id))
    end

    desc "Upload files to the bucket in the current state"
    task :upload_files do
      extra_options = { :write => fetch(:bucket_write_options), :redirect => fetch(:redirect_options) }
      Capistrano::S3::Publisher.publish!(fetch(:region), fetch(:access_key_id), fetch(:secret_access_key),
                             fetch(:bucket), fetch(:deployment_path), fetch(:target_path), fetch(:distribution_id), fetch(:invalidations), fetch(:exclusions), fetch(:only_gzip), extra_options)
    end
  end

  before :updated, :upload_s3 do
    invoke("deploy:s3:upload_files")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-s3-2.1.1 lib/capistrano/tasks/capistrano_3.rb
capistrano-s3-2.1.0 lib/capistrano/tasks/capistrano_3.rb