Sha256: ae1b0d412119d24977f070bb1786540cc8ad73425fb19846a962691f32f34cb4

Contents?: true

Size: 939 Bytes

Versions: 1

Compression:

Stored size: 939 Bytes

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(:s3_endpoint), fetch(:access_key_id), fetch(:secret_access_key), fetch(:bucket))
    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(:s3_endpoint), fetch(:access_key_id), fetch(:secret_access_key),
                             fetch(:bucket), fetch(:deployment_path), fetch(:distribution_id), fetch(:invalidations), fetch(:only_gzip), extra_options)
    end
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-s3-1.1.0 lib/capistrano/tasks/capistrano_3.rb