double-z
8/27/2013 - 10:43 PM

push omnibus built pkgs to s3

push omnibus built pkgs to s3

ruby_block "store in s3" do
  block do
    Gem.clear_paths
    require 'fog'
    connection = Fog::Storage.new(
      :provider => 'AWS',
      :aws_access_key_id => node[:fatty][:aws_access_key_id],
      :aws_secret_access_key => node[:fatty][:aws_secret_access_key]
    )
    directory = connection.directories.create(:key => "opscode-full-stack", :public => true)
    Dir["/tmp/fatty/pkg/*"].each do |filename|
      file = directory.files.create(:key => "#{node[:platform]}-#{node[:platform_version]}-#{node[:kernel][:machine]}/#{File.basename(filename)}", :body => File.open(filename), :public => true)
    end
  end
end