Sha256: 4a29e756e5d9cd063bdb5207cee3bb6042551fd09601a333a83e09e89f72944a
Contents?: true
Size: 893 Bytes
Versions: 19
Compression:
Stored size: 893 Bytes
Contents
module S3Website module Cloudfront class Invalidator def self.invalidate(config, changed_files) aws_key = config['s3_id'] aws_secret = config['s3_secret'] cloudfront_distribution_id = config['cloudfront_distribution_id'] s3_object_keys = apply_config config, changed_files s3_object_keys << "" report = SimpleCloudfrontInvalidator::CloudfrontClient.new( aws_key, aws_secret, cloudfront_distribution_id ).invalidate(s3_object_keys) puts report[:text_report] report[:invalidated_items_count] end private def self.apply_config(config, changed_files) if config['cloudfront_invalidate_root'] changed_files.map { |changed_file| changed_file.sub /\/index.html$/, '/' } else changed_files end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems