From ca3b96960a185313616438607b199dece329dd47 Mon Sep 17 00:00:00 2001 From: DhanashreeDorage Date: Fri, 5 Feb 2016 16:16:51 -0500 Subject: [PATCH 1/2] Increased no of attempts to get successful build Our database has a mirrored option so it takes extra time to launch. Every day build fails because the database is not available in given attempts. Need to increase no of attempts to get successful builds. --- lib/automan/cloudformation/launcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/automan/cloudformation/launcher.rb b/lib/automan/cloudformation/launcher.rb index ad4c272..dbb18f6 100644 --- a/lib/automan/cloudformation/launcher.rb +++ b/lib/automan/cloudformation/launcher.rb @@ -21,7 +21,7 @@ def initialize(options={}) super @wait = Wait.new({ delay: 120, - attempts: 15, # 15 x 2m == 30m + attempts: 25, # 25 x 2m == 50m debug: true, rescuer: WaitRescuer.new(), logger: @logger From 4f02cae8406e123b3bfffd6f63f0ba5c31c19248 Mon Sep 17 00:00:00 2001 From: DhanashreeDorage Date: Wed, 3 Aug 2016 14:19:52 -0400 Subject: [PATCH 2/2] Added aws version2 to our infrastructure (#1) * Added aws version2 to our infrastructure * Added aws version2 to our infrastructure * Added aws-sdk-v2 changes gemspec file and added env region in environment variable file --- automan.gemspec | 3 ++- lib/automan/beanstalk/configuration.rb | 8 ++++---- lib/automan/mixins/aws_caller.rb | 9 +++++++++ lib/automan/version.rb | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/automan.gemspec b/automan.gemspec index ea2e3f5..00e0734 100644 --- a/automan.gemspec +++ b/automan.gemspec @@ -22,7 +22,8 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rspec-core", "~> 3" spec.add_development_dependency "rspec-mocks", "~> 3" spec.add_development_dependency "rspec-expectations", "~> 3" - spec.add_dependency "aws-sdk", "< 2.0" + spec.add_dependency "aws-sdk-v1" + spec.add_dependency "aws-sdk","~> 2" spec.add_dependency "thor" spec.add_dependency "json" spec.add_dependency "wait" diff --git a/lib/automan/beanstalk/configuration.rb b/lib/automan/beanstalk/configuration.rb index 832ef84..09f15a8 100644 --- a/lib/automan/beanstalk/configuration.rb +++ b/lib/automan/beanstalk/configuration.rb @@ -17,8 +17,8 @@ def config_template_exists? } begin - response = eb.describe_configuration_settings opts - rescue AWS::ElasticBeanstalk::Errors::InvalidParameterValue => e + response = eb2.describe_configuration_settings opts + rescue Aws::ElasticBeanstalk::Errors::InvalidParameterValue => e if e.message.start_with? "No Configuration Template named" return false end @@ -43,7 +43,7 @@ def delete_config_template template_name: name } - response = eb.delete_configuration_template opts + response = eb2.delete_configuration_template opts unless response.successful? raise RequestFailedError, "delete_configuration_template failed: #{response.error}" @@ -94,7 +94,7 @@ def create_config_template option_settings: configuration_options } - response = eb.create_configuration_template opts + response = eb2.create_configuration_template opts unless response.successful? raise RequestFailedError, "create_configuration_template failed: #{response.error}" diff --git a/lib/automan/mixins/aws_caller.rb b/lib/automan/mixins/aws_caller.rb index 0f71eb2..d5e2960 100644 --- a/lib/automan/mixins/aws_caller.rb +++ b/lib/automan/mixins/aws_caller.rb @@ -1,4 +1,5 @@ require 'aws-sdk' +require 'aws-sdk-v1' module Automan module Mixins @@ -31,6 +32,14 @@ def eb end @eb end + + attr_writer :eb2 + def eb2 + if @eb2.nil? + @eb2 = Aws::ElasticBeanstalk::Client.new + end + @eb2 + end attr_writer :s3 def s3 diff --git a/lib/automan/version.rb b/lib/automan/version.rb index 1e32749..eeee602 100644 --- a/lib/automan/version.rb +++ b/lib/automan/version.rb @@ -1,3 +1,3 @@ module Automan - VERSION = "2.4.1" + VERSION = "2.6.1" end