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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 440002a8d4c58fd1329664656e61589e6d174e7330acfa73af957e8d2e690d7c
4
- data.tar.gz: 88a3fe213bfc823772d72296a130b37fca10032c8519597277d377e1abdfd798
3
+ metadata.gz: 16a5cbb7dcb7e4495352b0749f424e36c389a5eccfddbd40c5b41100431fb6c1
4
+ data.tar.gz: 1c6565c633be486655ada6443337fed2646a0fcff58108079a39fecded3fdb37
5
5
  SHA512:
6
- metadata.gz: 80f1c8e2e9f3fee310ff779dfcb9b1b4e7118ed27da2045441747b0783060fb9dc39022a6c23740167f76c9d4655999015a6858d68cdc2c906c73bfb2af99d4e
7
- data.tar.gz: 07ba99d048effdccd90f9a1185449e13e9829cb047d2c16c027c91834accd2610b053b460bc0f5eba8983ca49312a3238d817d9d5946cd81bd57ff4ce021f4b3
6
+ metadata.gz: 9769d64cb8c025d299b2d4dbc61881e6488a4fc7fcb7a9b165328ecfaa72528a411de8bda6e96fcf75a07029aa6e0d41e2a66f59f2f45d7b58d94390fde8422d
7
+ data.tar.gz: b70659ae2ba80a91dc1094dd479c1aefee7650aa0fa418315adcf2496fdadf9dd7bfca0de152098e5479c3629b0c0d3de1845905f974ebb251d0528993199fe4
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- # 0.13.1
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
@@ -9,4 +9,4 @@ group :test do
9
9
  gem 'rake', '~> 10.3.2'
10
10
  end
11
11
 
12
- gem 'nokogiri', '~> 1.8.2'
12
+ gem 'nokogiri', '~> 1.16.0'
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Stemcell
2
- VERSION = "0.13.2"
2
+ VERSION = "0.15.0"
3
3
  end
@@ -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::CookbookNotFound)
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', '~> 2.9'
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', '< 12.0.0']
29
+ s.add_runtime_dependency 'chef', ['>= 11.4.0', '< 19.0.0']
29
30
  end
30
31
 
31
- # this is a transitive dependency, but the latest vesion has a late ruby
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', '~> 1.8.2'
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.13.2
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: 2022-02-23 00:00:00.000000000 Z
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: '2.9'
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: '2.9'
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.8.2
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.8.2
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.0.3.1
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: