stemcell 0.13.1 → 0.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/stemcell/launcher.rb +8 -3
- data/lib/stemcell/option_parser.rb +12 -0
- data/lib/stemcell/version.rb +1 -1
- data/spec/lib/stemcell/launcher_spec.rb +13 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 440002a8d4c58fd1329664656e61589e6d174e7330acfa73af957e8d2e690d7c
|
4
|
+
data.tar.gz: 88a3fe213bfc823772d72296a130b37fca10032c8519597277d377e1abdfd798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80f1c8e2e9f3fee310ff779dfcb9b1b4e7118ed27da2045441747b0783060fb9dc39022a6c23740167f76c9d4655999015a6858d68cdc2c906c73bfb2af99d4e
|
7
|
+
data.tar.gz: 07ba99d048effdccd90f9a1185449e13e9829cb047d2c16c027c91834accd2610b053b460bc0f5eba8983ca49312a3238d817d9d5946cd81bd57ff4ce021f4b3
|
data/CHANGELOG.md
CHANGED
data/lib/stemcell/launcher.rb
CHANGED
@@ -47,6 +47,8 @@ module Stemcell
|
|
47
47
|
'dedicated_tenancy',
|
48
48
|
'associate_public_ip_address',
|
49
49
|
'count',
|
50
|
+
'min_count',
|
51
|
+
'max_count',
|
50
52
|
'security_groups',
|
51
53
|
'security_group_ids',
|
52
54
|
'tags',
|
@@ -102,16 +104,19 @@ module Stemcell
|
|
102
104
|
tags['Name'] = opts['chef_role'] if opts['chef_environment'] == 'production'
|
103
105
|
tags.merge!(opts['tags']) if opts['tags']
|
104
106
|
|
107
|
+
# Min/max number of instances to launch
|
108
|
+
min_count = opts['min_count'] || opts['count']
|
109
|
+
max_count = opts['max_count'] || opts['count']
|
110
|
+
|
105
111
|
# generate launch options
|
106
112
|
launch_options = {
|
107
113
|
:image_id => opts['image_id'],
|
108
114
|
:instance_type => opts['instance_type'],
|
109
115
|
:key_name => opts['key_name'],
|
110
|
-
:min_count =>
|
111
|
-
:max_count =>
|
116
|
+
:min_count => min_count,
|
117
|
+
:max_count => max_count,
|
112
118
|
}
|
113
119
|
|
114
|
-
|
115
120
|
# Associate Public IP can only bet set on network_interfaces, and if present
|
116
121
|
# security groups and subnet should be set on the interface. VPC-only.
|
117
122
|
# Primary network interface
|
@@ -259,6 +259,18 @@ module Stemcell
|
|
259
259
|
:type => Integer,
|
260
260
|
:env => 'COUNT'
|
261
261
|
},
|
262
|
+
{
|
263
|
+
:name => 'min_count',
|
264
|
+
:desc => "minimum number of instances to launch",
|
265
|
+
:type => Integer,
|
266
|
+
:env => 'MIN_COUNT'
|
267
|
+
},
|
268
|
+
{
|
269
|
+
:name => 'max_count',
|
270
|
+
:desc => "maximum number of instances to launch",
|
271
|
+
:type => Integer,
|
272
|
+
:env => 'MAX_COUNT'
|
273
|
+
},
|
262
274
|
{
|
263
275
|
:name => 'tail',
|
264
276
|
:desc => "interactively tail the initial converge",
|
data/lib/stemcell/version.rb
CHANGED
@@ -114,6 +114,19 @@ describe Stemcell::Launcher do
|
|
114
114
|
launched_instances = launcher.send(:launch, launch_options)
|
115
115
|
expect(launched_instances.map(&:public_ip_address)).to all(be_truthy)
|
116
116
|
end
|
117
|
+
|
118
|
+
it 'launches with min/max count' do
|
119
|
+
expect(launcher).to receive(:do_launch).with(a_hash_including(
|
120
|
+
:min_count => 3,
|
121
|
+
:max_count => 6,
|
122
|
+
)).and_return(instances)
|
123
|
+
options = launch_options.merge(
|
124
|
+
'min_count' => 3,
|
125
|
+
'max_count' => 6,
|
126
|
+
)
|
127
|
+
launched_instances = launcher.send(:launch,
|
128
|
+
launch_options.merge('min_count' => 3, 'max_count' => 6))
|
129
|
+
end
|
117
130
|
end
|
118
131
|
|
119
132
|
describe '#kill' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stemcell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Rhoads
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2022-
|
14
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: aws-eventstream
|
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
- !ruby/object:Gem::Version
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
|
-
rubygems_version: 3.0.3
|
270
|
+
rubygems_version: 3.0.3.1
|
271
271
|
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: no summary
|