Sha256: 4c2ab7a0d2e07e29ccfd427b9eb8e03b1aed9eab590e003e811ccd526d7bc47f

Contents?: true

Size: 698 Bytes

Versions: 21

Compression:

Stored size: 698 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'aws/s3'

include AWS::S3

USER_DATA = `wget -q -O - http://169.254.169.254/latest/user-data`.split("\n")

bucket_name = ARGV[0].strip
channel     = ARGV[1].strip

def get_access_keys
  access_key        = USER_DATA[0].to_s.strip
  secret_access_key = USER_DATA[1].to_s.strip
  keys = { :access_key_id => access_key,
           :secret_access_key => secret_access_key}
end #get_access_keys

AWS::S3::Base.establish_connection!(get_access_keys)

objects = Bucket.objects(bucket_name, :prefix => channel)
files = []
objects.each { |obj| files << "#{obj.key}" }

files.each do |file|
  puts "Deleting #{file}"
  S3Object.delete file, bucket_name
end #do

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 installer/utils/delete_from_s3.rb
rhoconnect-7.5.1 installer/utils/delete_from_s3.rb
rhoconnect-7.4.1 installer/utils/delete_from_s3.rb
rhoconnect-7.1.17 installer/utils/delete_from_s3.rb
rhoconnect-6.2.0 installer/utils/delete_from_s3.rb
rhoconnect-6.0.11 installer/utils/delete_from_s3.rb
rhoconnect-5.5.18 installer/utils/delete_from_s3.rb
rhoconnect-5.5.17 installer/utils/delete_from_s3.rb
rhoconnect-5.5.15 installer/utils/delete_from_s3.rb
rhoconnect-5.5.0.22 installer/utils/delete_from_s3.rb
rhoconnect-5.5.2 installer/utils/delete_from_s3.rb
rhoconnect-5.5.0.7 installer/utils/delete_from_s3.rb
rhoconnect-5.5.0.3 installer/utils/delete_from_s3.rb
rhoconnect-5.5.0 installer/utils/delete_from_s3.rb
rhoconnect-5.1.1 installer/utils/delete_from_s3.rb
rhoconnect-4.0.4 installer/utils/delete_from_s3.rb
rhoconnect-4.0.3 installer/utils/delete_from_s3.rb
rhoconnect-4.0.2 installer/utils/delete_from_s3.rb
rhoconnect-4.0.1 installer/utils/delete_from_s3.rb
rhoconnect-4.0.0 installer/utils/delete_from_s3.rb