stemcell 0.13.2 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/Gemfile +1 -1
- data/lib/stemcell/launcher.rb +2 -1
- data/lib/stemcell/version.rb +1 -1
- data/spec/lib/stemcell/launcher_spec.rb +45 -0
- data/spec/lib/stemcell/metadata_source/chef_repository_spec.rb +1 -1
- data/stemcell.gemspec +5 -8
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16a5cbb7dcb7e4495352b0749f424e36c389a5eccfddbd40c5b41100431fb6c1
|
4
|
+
data.tar.gz: 1c6565c633be486655ada6443337fed2646a0fcff58108079a39fecded3fdb37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9769d64cb8c025d299b2d4dbc61881e6488a4fc7fcb7a9b165328ecfaa72528a411de8bda6e96fcf75a07029aa6e0d41e2a66f59f2f45d7b58d94390fde8422d
|
7
|
+
data.tar.gz: b70659ae2ba80a91dc1094dd479c1aefee7650aa0fa418315adcf2496fdadf9dd7bfca0de152098e5479c3629b0c0d3de1845905f974ebb251d0528993199fe4
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
# 0.
|
1
|
+
# 0.15.0
|
2
|
+
- Upgrade Chef to 18 and Nokogiri to 1.16 for compatibility with newer Ruby versions
|
3
|
+
|
4
|
+
# 0.14.0
|
5
|
+
- Adds support for specifying a custom bootstrap template file
|
6
|
+
|
7
|
+
# 0.13.2
|
2
8
|
- Support for specifying --min-count and --max-count
|
3
9
|
|
4
10
|
# 0.13.1
|
data/Gemfile
CHANGED
data/lib/stemcell/launcher.rb
CHANGED
@@ -83,6 +83,7 @@ module Stemcell
|
|
83
83
|
@aws_secret_key = opts['aws_secret_key']
|
84
84
|
@aws_session_token = opts['aws_session_token']
|
85
85
|
@max_attempts = opts['max_attempts'] || 3
|
86
|
+
@bootstrap_template_path = opts['bootstrap_template_path']
|
86
87
|
configure_aws_creds_and_region
|
87
88
|
end
|
88
89
|
|
@@ -257,7 +258,7 @@ module Stemcell
|
|
257
258
|
|
258
259
|
# this is made public for ec2admin usage
|
259
260
|
def render_template(opts={})
|
260
|
-
template_file_path = File.expand_path(TEMPLATE_PATH, __FILE__)
|
261
|
+
template_file_path = @bootstrap_template_path || File.expand_path(TEMPLATE_PATH, __FILE__)
|
261
262
|
template_file = File.read(template_file_path)
|
262
263
|
erb_template = ERB.new(template_file)
|
263
264
|
last_bootstrap_line = LAST_BOOTSTRAP_LINE
|
data/lib/stemcell/version.rb
CHANGED
@@ -23,6 +23,51 @@ describe Stemcell::Launcher do
|
|
23
23
|
end
|
24
24
|
let(:instance_ids) { instances.map(&:id) }
|
25
25
|
|
26
|
+
describe '#render_template' do
|
27
|
+
|
28
|
+
context 'when bootstrap_template_path is not provided' do
|
29
|
+
let(:subject) do
|
30
|
+
launcher.render_template()
|
31
|
+
end
|
32
|
+
|
33
|
+
before do
|
34
|
+
allow(File).to receive(:expand_path).and_return('/path/to/default/bootstrap.sh.erb')
|
35
|
+
allow(File).to receive(:read).and_return('default template content')
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'launches the default template' do
|
39
|
+
expect(File).to receive(:expand_path)
|
40
|
+
expect(File).to receive(:read).with('/path/to/default/bootstrap.sh.erb')
|
41
|
+
|
42
|
+
expect(subject).not_to be_empty
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'when bootstrap_template_path is provided' do
|
47
|
+
let(:subject) do
|
48
|
+
launcher.render_template()
|
49
|
+
end
|
50
|
+
|
51
|
+
let(:launcher) do
|
52
|
+
opts = {'region' => 'region', 'vpc_id' => 'vpc-1', 'bootstrap_template_path' => '/path/to/file.sh.erb'}
|
53
|
+
launcher = Stemcell::Launcher.new(opts)
|
54
|
+
|
55
|
+
launcher
|
56
|
+
end
|
57
|
+
|
58
|
+
before do
|
59
|
+
allow(File).to receive(:read).and_return('custom template content')
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'launches the override template' do
|
63
|
+
expect(File).not_to receive(:expand_path)
|
64
|
+
expect(File).to receive(:read).with('/path/to/file.sh.erb')
|
65
|
+
|
66
|
+
expect(subject).not_to be_empty
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
26
71
|
describe '#launch' do
|
27
72
|
let(:ec2) do
|
28
73
|
ec2 = Aws::EC2::Client.new
|
@@ -116,7 +116,7 @@ describe Stemcell::MetadataSource::ChefRepository do
|
|
116
116
|
let(:role) { 'unit-simple-none' }
|
117
117
|
let(:cookbook_attributes) { ['unknown::attr'] }
|
118
118
|
it "raises an error" do
|
119
|
-
expect { result_metadata }.to raise_error(Chef::Exceptions::
|
119
|
+
expect { result_metadata }.to raise_error(Chef::Exceptions::CookbookNotFoundInRepo)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
data/stemcell.gemspec
CHANGED
@@ -18,25 +18,22 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
20
|
# pins several aws sdk transitive dependencies to maintain compatibility with Ruby < 2.3
|
21
|
+
s.add_runtime_dependency 'aws-sdk-core', '~> 3.130.2'
|
21
22
|
s.add_runtime_dependency 'aws-eventstream', '~> 1.1.1'
|
22
23
|
s.add_runtime_dependency 'aws-sdk-ec2', '~> 1'
|
23
24
|
s.add_runtime_dependency 'aws-sigv4', '~> 1.2.4'
|
24
|
-
s.add_runtime_dependency 'net-ssh', '~>
|
25
|
+
s.add_runtime_dependency 'net-ssh', '~> 7.1'
|
25
26
|
if RUBY_VERSION >= '2.0'
|
26
27
|
s.add_runtime_dependency 'chef', '>= 11.4.0'
|
27
28
|
else
|
28
|
-
s.add_runtime_dependency 'chef', ['>= 11.4.0', '<
|
29
|
+
s.add_runtime_dependency 'chef', ['>= 11.4.0', '< 19.0.0']
|
29
30
|
end
|
30
31
|
|
31
|
-
|
32
|
-
# version dependency. lets explicitly include it here. if this becomes
|
33
|
-
# no-longer a dependency of chef via chef-zero, then remove it
|
34
|
-
s.add_runtime_dependency 'rack', '< 2.0.0'
|
35
|
-
s.add_runtime_dependency 'nokogiri', '~> 1.8.2'
|
32
|
+
s.add_runtime_dependency 'nokogiri', '~> 1.16.0'
|
36
33
|
s.add_runtime_dependency 'ffi-yajl', '< 2.3.1'
|
37
34
|
|
38
35
|
s.add_runtime_dependency 'trollop', '~> 2.1'
|
39
36
|
s.add_runtime_dependency 'aws-creds', '~> 0.2.3'
|
40
37
|
s.add_runtime_dependency 'colored', '~> 1.2'
|
41
|
-
s.add_runtime_dependency 'json', '
|
38
|
+
s.add_runtime_dependency 'json', '>= 1.8.2'
|
42
39
|
end
|
metadata
CHANGED
@@ -1,18 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stemcell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Rhoads
|
8
8
|
- Igor Serebryany
|
9
9
|
- Nelson Gauthier
|
10
10
|
- Patrick Viet
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: aws-sdk-core
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.130.2
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.130.2
|
16
30
|
- !ruby/object:Gem::Dependency
|
17
31
|
name: aws-eventstream
|
18
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,14 +75,14 @@ dependencies:
|
|
61
75
|
requirements:
|
62
76
|
- - "~>"
|
63
77
|
- !ruby/object:Gem::Version
|
64
|
-
version: '
|
78
|
+
version: '7.1'
|
65
79
|
type: :runtime
|
66
80
|
prerelease: false
|
67
81
|
version_requirements: !ruby/object:Gem::Requirement
|
68
82
|
requirements:
|
69
83
|
- - "~>"
|
70
84
|
- !ruby/object:Gem::Version
|
71
|
-
version: '
|
85
|
+
version: '7.1'
|
72
86
|
- !ruby/object:Gem::Dependency
|
73
87
|
name: chef
|
74
88
|
requirement: !ruby/object:Gem::Requirement
|
@@ -83,34 +97,20 @@ dependencies:
|
|
83
97
|
- - ">="
|
84
98
|
- !ruby/object:Gem::Version
|
85
99
|
version: 11.4.0
|
86
|
-
- !ruby/object:Gem::Dependency
|
87
|
-
name: rack
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
89
|
-
requirements:
|
90
|
-
- - "<"
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 2.0.0
|
93
|
-
type: :runtime
|
94
|
-
prerelease: false
|
95
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
-
requirements:
|
97
|
-
- - "<"
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
version: 2.0.0
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
name: nokogiri
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
104
|
- - "~>"
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
version: 1.
|
106
|
+
version: 1.16.0
|
107
107
|
type: :runtime
|
108
108
|
prerelease: false
|
109
109
|
version_requirements: !ruby/object:Gem::Requirement
|
110
110
|
requirements:
|
111
111
|
- - "~>"
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: 1.
|
113
|
+
version: 1.16.0
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: ffi-yajl
|
116
116
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,14 +171,14 @@ dependencies:
|
|
171
171
|
name: json
|
172
172
|
requirement: !ruby/object:Gem::Requirement
|
173
173
|
requirements:
|
174
|
-
- - "
|
174
|
+
- - ">="
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: 1.8.2
|
177
177
|
type: :runtime
|
178
178
|
prerelease: false
|
179
179
|
version_requirements: !ruby/object:Gem::Requirement
|
180
180
|
requirements:
|
181
|
-
- - "
|
181
|
+
- - ">="
|
182
182
|
- !ruby/object:Gem::Version
|
183
183
|
version: 1.8.2
|
184
184
|
description: A tool for launching and bootstrapping EC2 instances
|
@@ -252,7 +252,7 @@ homepage: https://github.com/airbnb/stemcell
|
|
252
252
|
licenses:
|
253
253
|
- MIT
|
254
254
|
metadata: {}
|
255
|
-
post_install_message:
|
255
|
+
post_install_message:
|
256
256
|
rdoc_options: []
|
257
257
|
require_paths:
|
258
258
|
- lib
|
@@ -267,8 +267,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
- !ruby/object:Gem::Version
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
|
-
rubygems_version: 3.
|
271
|
-
signing_key:
|
270
|
+
rubygems_version: 3.5.22
|
271
|
+
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: no summary
|
274
274
|
test_files:
|