Sha256: fbf4642d60d46fbf3dfc3b3bb91a5911bcab2c42f8330465f7fe4d747f98ef28

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 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), fetch(:stage))
    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), fetch(:stage))
    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), :object_write => fetch(:object_write_options), :prefer_cf_mime_types => fetch(:prefer_cf_mime_types) }
      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, fetch(:stage))
    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-2.4.0 lib/capistrano/tasks/capistrano_3.rb