Skip to content

Commit

Permalink
Bump for aws-sdk v2
Browse files Browse the repository at this point in the history
aws-sdk v1 deprecated poorly.

Change-Id: I0d379ca603c9ffd50e141285a2ac62850bc74a62
  • Loading branch information
Clarke Brunsdon committed Aug 6, 2015
1 parent 23049b5 commit bad454d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/oops/opsworks_deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class OpsworksDeploy
attr_accessor :stack_name, :app_name

def initialize(app_name, stack_name)
@client = AWS::OpsWorks::Client.new
@client = Aws::OpsWorks::Client.new
self.stack_name = stack_name
self.app_name = app_name
end
Expand Down
9 changes: 5 additions & 4 deletions lib/oops/tasks.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'oops/opsworks_deploy'
require 'aws'
require 'aws-sdk'
require 'rake'

module Oops
Expand Down Expand Up @@ -82,8 +82,8 @@ def create_task!
s3 = s3_object(file_path)

puts "Starting upload..."
s3.write(file: "build/#{file_path}")
puts "Uploaded Application: #{s3.url_for(:read)}"
s3.upload_file("build/#{file_path}")
puts "Uploaded Application: #{s3.public_url}"
end

task :deploy, :app_name, :stack_name, :filename do |t, args|
Expand Down Expand Up @@ -116,7 +116,8 @@ def create_task!

private
def s3_object file_path
AWS::S3.new.buckets[bucket_name].objects["#{package_folder}/#{file_path}"]
s3 = Aws::S3::Resource.new
s3.bucket(bucket_name).object("#{package_folder}/#{file_path}")
end

def s3_url file_path
Expand Down
2 changes: 1 addition & 1 deletion oops.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency "aws-sdk", "~> 1.11"
spec.add_dependency "aws-sdk", "~> 2.0"
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
end

0 comments on commit bad454d

Please sign in to comment.