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 +4 -4
- data/README.md +2 -0
- data/lib/autocanary24/canarystack.rb +3 -1
- data/lib/autocanary24/client.rb +4 -1
- data/lib/autocanary24/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2c33ce811b08c46f80e62f88972f2b577f41042
|
4
|
+
data.tar.gz: 350fa844da5b22db7d152b594b0de966db960986
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf08b527762678bf3da7c8c39989da89c551d7907e130aff92f17229a4910a48ab0dff8398d134099e81f154b7831433f8cdfe1f9373df9e8641485311a9b902
|
7
|
+
data.tar.gz: b3b11bbd8f3a83c71e344b9250e9e80f80083e5f277d16ddcb1250486ce8a575ec28010d03e7e339548d9921a74b9819ae449fade40a590d554d68e1ccbfcc1a
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# AutoCanary24
|
2
2
|
|
3
|
+
[](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]
|
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
|
|
data/lib/autocanary24/client.rb
CHANGED
@@ -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
|
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]
|
data/lib/autocanary24/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|