hako 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df6d36f3dcad17f7d794bb91775db9f74fb96c70
4
- data.tar.gz: 3eaaf846fbb6306ef95235f5092c27f33bd94dcf
3
+ metadata.gz: aa7641f4bc5a2a92d28a326367a5a0138b93e21b
4
+ data.tar.gz: 01c8ac47831b5e3b2126e426346323de9de79f6e
5
5
  SHA512:
6
- metadata.gz: 2fb9a1d911b4c3a02693f6204bfeb1a66e0ed4655ff6aff36aafb08e0c69a9cf21e8343306faa6ff0952b313e37abc28aaf000678309ad20e16fd5c1f863538a
7
- data.tar.gz: 32fb06237271a486c2d41fbdd5a2de64128418833ff6c6d82dab560a8f8ae8f273661687bd82552ee922ed0c35bf7b5ba0c1a9ec4bd4b635a4437c58ab1f21d9
6
+ metadata.gz: bffcb73040eef086bf53fbed295d1579d7a1b74601547f18377db49a1b4bd3d6b2790557ec7b44ddb1b5c98551e63800458ae408e51d52a915338c1fa32dcc1b
7
+ data.tar.gz: 2488c2f9e7893676f9cbb5397789ab2a2887a9dd1cec82e33abb25b188ee95ac4d7211616df598697432c44c1b788affe358d8080202ee6be6280e665f797e66
@@ -4,12 +4,12 @@ AllCops:
4
4
  DisplayCopNames: true
5
5
  TargetRubyVersion: 2.3
6
6
 
7
+ Layout/FirstParameterIndentation:
8
+ Enabled: false
9
+
7
10
  Style/Alias:
8
11
  EnforcedStyle: prefer_alias_method
9
12
 
10
- Style/FirstParameterIndentation:
11
- Enabled: false
12
-
13
13
  Style/GuardClause:
14
14
  Enabled: false
15
15
 
@@ -1,3 +1,7 @@
1
+ # 1.5.0 (2017-06-05)
2
+ ## New features
3
+ - Support `load_balancer_attributes` option in elb_v2
4
+
1
5
  # 1.4.0 (2017-05-25)
2
6
  ## New features
3
7
  - Support `ulimits` option
@@ -22,6 +22,10 @@ scheduler:
22
22
  - subnet-YYYYYYYY
23
23
  security_groups:
24
24
  - sg-ZZZZZZZZ
25
+ load_balancer_attributes:
26
+ access_logs.s3.enabled: 'true'
27
+ access_logs.s3.bucket: hako-access-logs
28
+ access_logs.s3.prefix: hako-hello-lb-v2
25
29
  app:
26
30
  image: ryotarai/hello-sinatra
27
31
  memory: 128
@@ -67,6 +67,7 @@ module Hako
67
67
  if @autoscaling
68
68
  @autoscaling.apply(Aws::ECS::Types::Service.new(cluster_arn: @cluster, service_name: @app_id))
69
69
  end
70
+ ecs_elb_client.modify_attributes
70
71
  else
71
72
  current_service = describe_service
72
73
  task_definition_changed, task_definition = register_task_definition(definitions)
@@ -84,11 +85,13 @@ module Hako
84
85
  if @autoscaling
85
86
  @autoscaling.apply(current_service)
86
87
  end
88
+ ecs_elb_client.modify_attributes
87
89
  else
88
90
  Hako.logger.info "Updated service: #{service.service_arn}"
89
91
  if @autoscaling
90
92
  @autoscaling.apply(service)
91
93
  end
94
+ ecs_elb_client.modify_attributes
92
95
  unless wait_for_ready(service)
93
96
  if task_definition_changed
94
97
  Hako.logger.error("Rolling back to #{current_service.task_definition}")
@@ -635,6 +638,11 @@ module Hako
635
638
  Hako.logger.debug(" s3://#{uri.host}/#{started_key} doesn't exist")
636
639
  else
637
640
  json = JSON.parse(object.body.read)
641
+ arn = json['detail']['containerInstanceArn']
642
+ if @container_instance_arn != arn
643
+ @container_instance_arn = arn
644
+ report_container_instance(@container_instance_arn)
645
+ end
638
646
  @started_at = Time.parse(json['detail']['startedAt'])
639
647
  if @started_at
640
648
  Hako.logger.info "Started at #{@started_at}"
@@ -98,7 +98,21 @@ module Hako
98
98
 
99
99
  # @return [nil]
100
100
  def modify_attributes
101
- # Nothing implemented for now
101
+ unless @elb_v2_config
102
+ return nil
103
+ end
104
+
105
+ if @elb_v2_config.key?('load_balancer_attributes')
106
+ load_balancer = describe_load_balancer
107
+ attributes = @elb_v2_config.fetch('load_balancer_attributes').map { |key, value| { key: key, value: value } }
108
+ if @dry_run
109
+ Hako.logger.info("elb_client.modify_load_balancer_attributes(load_balancer_arn: #{load_balancer.load_balancer_arn}, attributes: #{attributes.inspect}) (dry-run)")
110
+ else
111
+ Hako.logger.info("Updating ELBv2 attributes to #{attributes.inspect}")
112
+ elb_client.modify_load_balancer_attributes(load_balancer_arn: load_balancer.load_balancer_arn, attributes: attributes)
113
+ end
114
+ end
115
+ nil
102
116
  end
103
117
 
104
118
  # @return [nil]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hako
4
- VERSION = '1.4.0'
4
+ VERSION = '1.5.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hako
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-25 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk