lib/dpl/provider/code_deploy.rb in dpl-1.7.8.travis.647.1 vs lib/dpl/provider/code_deploy.rb in dpl-1.7.8.travis.649.1

- old
+ new

@@ -1,23 +1,23 @@ require 'json' module DPL class Provider class CodeDeploy < Provider - requires 'aws-sdk-v1' + requires 'aws-sdk' def code_deploy @code_deploy ||= begin - Aws.add_service('CodeDeploy', api: File.expand_path("../CodeDeploy.api.json", __FILE__)) unless defined? Aws::CodeDeploy - Aws::CodeDeploy::Client.new(code_deploy_options) + ::Aws.add_service('CodeDeploy', api: File.expand_path("../CodeDeploy.api.json", __FILE__)) unless defined? ::Aws::CodeDeploy + ::Aws::CodeDeploy::Client.new(code_deploy_options) end end def code_deploy_options code_deploy_options = { region: options[:region] || 'us-east-1', - credentials: Aws::Credentials.new(option(:access_key_id), option(:secret_access_key)) + credentials: ::Aws::Credentials.new(option(:access_key_id), option(:secret_access_key)) } code_deploy_options[:endpoint] = options[:endpoint] if options[:endpoint] code_deploy_options end @@ -61,10 +61,10 @@ application_name: options[:application] || option(:application_name), deployment_group_name: options[:deployment_group] || option(:deployment_group_name), description: options[:description] || default_description }) log "Triggered deployment #{deployment.deployment_id.inspect}." - rescue Aws::CodeDeploy::Errors::DeploymentLimitExceededException => exception + rescue ::Aws::CodeDeploy::Errors::DeploymentLimitExceededException => exception error(exception.message) end def bundle_type if s3_key =~ /\.(tar|tgz|zip)$/