autocanary24 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8cf4cb43f616b217f59cdd35f148e9e7747e5fd
4
- data.tar.gz: a1733265748fc179e835b7fc062f24b90146b35f
3
+ metadata.gz: d2c33ce811b08c46f80e62f88972f2b577f41042
4
+ data.tar.gz: 350fa844da5b22db7d152b594b0de966db960986
5
5
  SHA512:
6
- metadata.gz: b60821bc03cad2bd04ec1be8a8adb5e6657e8c6b6be3e9ac159df47c7154bd36435520307ea085b105203dbffe119d669743813e280b92a4bb70eafc718921e1
7
- data.tar.gz: 8f7c432d4b3333059a77a468eebb9b4eda13d40599f89fb65926090caba4622fa56072615529c513aeccefb37b3b3e8506f37ba149605c7a082b1e1e9f700fba
6
+ metadata.gz: cf08b527762678bf3da7c8c39989da89c551d7907e130aff92f17229a4910a48ab0dff8398d134099e81f154b7831433f8cdfe1f9373df9e8641485311a9b902
7
+ data.tar.gz: b3b11bbd8f3a83c71e344b9250e9e80f80083e5f277d16ddcb1250486ce8a575ec28010d03e7e339548d9921a74b9819ae449fade40a590d554d68e1ccbfcc1a
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # AutoCanary24
2
2
 
3
+ [![Build Status](https://travis-ci.org/AutoScout24/autocanary24.svg)](https://travis-ci.org/AutoScout24/autocanary24)
4
+
3
5
  AutoCanary24 is a ruby utility to do [blue/green](http://martinfowler.com/bliki/BlueGreenDeployment.html) and [canary](http://martinfowler.com/bliki/CanaryRelease.html) deployments with AWS CloudFormation stacks.
4
6
 
5
7
  This library use the [Swap AutoScaling Groups](http://www.slideshare.net/AmazonWebServices/dvo401-deep-dive-into-bluegreen-deployments-on-aws/32) approach and expects two stacks. A "base" stack which includes at least the `ELB` and another which includes the `AutoScaling Group`.
@@ -77,7 +77,9 @@ module AutoCanary24
77
77
  def get_instance_ids
78
78
  asg = get_autoscaling_group
79
79
  asg_client = Aws::AutoScaling::Client.new
80
- describe_asg(asg)[:instances].map{ |i| { instance_id: i[:instance_id] } }
80
+ describe_asg(asg)[:instances] \
81
+ .select { |i| i[:lifecycle_state]=="InService" } \
82
+ .map{ |i| { instance_id: i[:instance_id] } }
81
83
  end
82
84
 
83
85
 
@@ -94,12 +94,15 @@ module AutoCanary24
94
94
  instances_to_toggle = 1 if (instances_to_toggle < 1)
95
95
 
96
96
  instances_to_attach = stacks[:stack_to_create].get_instance_ids
97
+ write_log(stacks[:stack_to_create].stack_name, "Instances to attach: #{instances_to_attach}")
98
+
97
99
  instances_to_detach = stacks[:stack_to_delete].nil? ? [] : stacks[:stack_to_delete].get_instance_ids
100
+ write_log(stacks[:stack_to_delete].stack_name, "Instances to detach: #{instances_to_detach}")
98
101
 
99
102
  missing = desired
100
103
  while missing > 0
101
104
 
102
- write_log(stacks[:stack_to_create].stack_name, "Adding #{instances_to_toggle} instances (#{desired-missing+instances_to_toggle}/#{desired})")
105
+ write_log(stacks[:stack_to_create].stack_name, "Adding #{instances_to_toggle} instances (#{instances_to_attach[desired-missing, instances_to_toggle]})")
103
106
 
104
107
  already_attached_instances = instances_to_attach[0, desired-missing+instances_to_toggle]
105
108
  already_detached_instances = instances_to_detach[0, desired-missing]
@@ -1,3 +1,3 @@
1
1
  module AutoCanary24
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autocanary24
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Garbe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-01 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autostacker24
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 2.4.5.1
141
+ rubygems_version: 2.5.1
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Library for blue/green and canary deployments with CloudFormation.