poise-boiler 1.15.0 → 1.16.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
  SHA1:
3
- metadata.gz: dc759a1609799e0922269ecb5c7c49540d50c0f4
4
- data.tar.gz: fd4be17592f8b129effff151b14405683affd658
3
+ metadata.gz: 1c4fb3bfa6f761790438770520c9da3a00d27d3f
4
+ data.tar.gz: f0fd873026544e9407e4828a2b82d4d08ab151b8
5
5
  SHA512:
6
- metadata.gz: 3824c2a34bcce2f1c5aaf7a5c7ffeb240a9c982fb638a10cc4ab28bc0d5bbd75efa169cac2b7f526f520a0274b286a6c88e44d0ed8ef0e939aec612cc5ea934a
7
- data.tar.gz: eed02e137bd93ce211d29721fd3e3900fba8e1c418a5d99d0a869eeed5a8c83dc10c237097d64bd56a874f12e2a4e346155a206d27c2b3de2a9da6d7d5feecd3
6
+ metadata.gz: f08303ed019060ef16e3a2734fb5ad32db5a718b9fa95b0e597a3082fdc7057a8c95742c89a95c5d506fb52df864e7d23213b88dfed5e56fd24f6abdb58e6336
7
+ data.tar.gz: bca5054061b44c5be66344dd8802cdf7c3b8d94200c22d2cf6158f7732bfc3011de62d11f3b57d2090cf145d7ca10f0773ee91c4ee11bf56f8587b3b77042574
@@ -1,17 +1,21 @@
1
1
  sudo: false
2
2
  cache: bundler
3
3
  language: ruby
4
- addons:
5
- apt:
6
- packages:
7
- - libgecode-dev
8
- rvm:
9
- - 2.3.1
10
- gemfile:
11
- - gemfiles/default.gemfile
12
- - gemfiles/master.gemfile
13
- env:
14
- global:
15
- - USE_SYSTEM_GECODE=true
16
- before_install: "gem install bundler"
17
- script: bundle exec rake test
4
+ before_install:
5
+ - 'if [[ $BUNDLE_GEMFILE == *master.gemfile ]]; then gem update --system; fi'
6
+ - gem --version
7
+ - gem install bundler
8
+ - bundle --version
9
+ - 'bundle config --local path ${BUNDLE_PATH:-$(dirname $BUNDLE_GEMFILE)/vendor/bundle}'
10
+ - bundle config --local bin $PWD/bin
11
+ install: bundle update --jobs=3 --retry=3
12
+ script:
13
+ - ./bin/rake travis
14
+ matrix:
15
+ include:
16
+ - rvm: 2.3.1
17
+ gemfile: gemfiles/chef-12.gemfile
18
+ - rvm: 2.4.1
19
+ gemfile: gemfiles/chef-13.gemfile
20
+ - rvm: 2.4.1
21
+ gemfile: gemfiles/master.gemfile
@@ -1,5 +1,12 @@
1
1
  # Poise-Boiler Changelog
2
2
 
3
+ ## 1.16.0
4
+
5
+ * Dropping Ubuntu 12.04 from the `linux` platform alias and adding 16.04.
6
+ * Adding my IRB extension gems.
7
+ * Use Test Kitchen's policyfile support for Chef versions that allow it.
8
+ * Dependency version updates.
9
+
3
10
  ## 1.15.0
4
11
 
5
12
  * Support gathering development dependencies from cookbook gems when using the
@@ -15,3 +15,5 @@
15
15
  #
16
16
 
17
17
  eval_gemfile File.expand_path('../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 12.0'
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2015-2016, Noah Kantrowitz
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ eval_gemfile File.expand_path('../../Gemfile', __FILE__)
18
+
19
+ gem 'chef', '~> 13.0'
@@ -16,6 +16,9 @@
16
16
 
17
17
  eval_gemfile File.expand_path('../../Gemfile', __FILE__)
18
18
 
19
- gem 'chef', github: 'chef/chef'
20
- gem 'halite', github: 'poise/halite'
21
- gem 'ohai', github: 'chef/ohai'
19
+ gem 'chef', git: 'https://github.com/chef/chef.git'
20
+ gem 'chefspec', git: 'https://github.com/sethvargo/chefspec.git'
21
+ gem 'fauxhai', git: 'https://github.com/customink/fauxhai.git'
22
+ gem 'foodcritic', git: 'https://github.com/foodcritic/foodcritic.git'
23
+ gem 'halite', git: 'https://github.com/poise/halite.git'
24
+ gem 'ohai', git: 'https://github.com/chef/ohai.git'
@@ -30,7 +30,7 @@ module PoiseBoiler
30
30
  PLATFORM_ALIASES = {
31
31
  'windows' => %w{windows-2012r2},
32
32
  'windows32' => %w{windows-2008sp2},
33
- 'ubuntu' => %w{ubuntu-12.04 ubuntu-14.04},
33
+ 'ubuntu' => %w{ubuntu-14.04 ubuntu-16.04},
34
34
  'rhel' => %w{centos},
35
35
  'centos' => %w{centos-6 centos-7},
36
36
  'linux' => %w{ubuntu rhel centos},
@@ -268,6 +268,8 @@ module PoiseBoiler
268
268
  'aws_ssh_key_id' => "#{cookbook_name}-kitchen",
269
269
  'security_group_ids' => ENV['AWS_SECURITY_GROUP_ID'] ? [ENV['AWS_SECURITY_GROUP_ID']] : [DEFAULT_EC2_SECURITY_GROUP_ID],
270
270
  'subnet_id' => ENV['AWS_SUBNET_ID'] || DEFAULT_EC2_SUBNET_ID,
271
+ # Because kitchen-rackspace also has a thing called flavor_id.
272
+ 'flavor_id' => nil,
271
273
  }
272
274
  end
273
275
 
@@ -16,17 +16,23 @@
16
16
 
17
17
  require 'fileutils'
18
18
 
19
- # From chef-dk.
20
- require 'kitchen/provisioner/policyfile_zero'
19
+ require 'chef/version'
21
20
  require 'mixlib/shellout'
22
21
 
23
22
  require 'poise_boiler/helpers/kitchen/provisioner_helpers'
24
23
 
24
+ $use_policyfile_zero = Gem::Requirement.create('< 12.7').satisfied_by?(Gem::Version.create(Chef::VERSION))
25
+
26
+ if $use_policyfile_zero
27
+ require 'kitchen/provisioner/policyfile_zero'
28
+ else
29
+ require 'kitchen/provisioner/chef_zero'
30
+ end
25
31
 
26
32
  module PoiseBoiler
27
33
  module Helpers
28
34
  class Kitchen
29
- class PolicyProvisioner < ::Kitchen::Provisioner::PolicyfileZero
35
+ class PolicyProvisioner < ($use_policyfile_zero ? ::Kitchen::Provisioner::PolicyfileZero : ::Kitchen::Provisioner::ChefZero )
30
36
  include ProvisionerHelpers
31
37
 
32
38
  # Override the default value from the base class.
@@ -51,18 +57,26 @@ module PoiseBoiler
51
57
  # Compile that policy because the base provider doesn't do that.
52
58
  compile_poise_policy(policy_path)
53
59
  # Tell the base provider code to use our new policy instead.
54
- config[:policyfile] = policy_path
60
+ if $use_policyfile_zero
61
+ config[:policyfile] = "#{config[:kitchen_root]}/#{policy_path}"
62
+ else
63
+ config[:policyfile_path] = policy_path
64
+ end
55
65
  super
56
66
  end
57
67
 
68
+ def cleanup_sandbox
69
+ super if @sandbox_path
70
+ end
71
+
58
72
  private
59
73
 
60
74
  def generate_poise_policy(base)
61
75
  info("Preparing modified policy")
62
76
  original_policy = IO.read(config[:policyfile])
63
77
  new_policy = "default_source :chef_repo, #{base.inspect}\n#{original_policy}"
64
- policy_path = File.join(config[:kitchen_root], '.kitchen', "poise_policy_#{instance.name}.rb")
65
- IO.write(policy_path, new_policy)
78
+ policy_path = ".kitchen/poise_policy_#{instance.name}.rb"
79
+ IO.write("#{config[:kitchen_root]}/#{policy_path}", new_policy)
66
80
  policy_path
67
81
  end
68
82
 
@@ -52,7 +52,7 @@ module PoiseBoiler
52
52
 
53
53
  file '.ssh/id_rsa' do
54
54
  # Add a zero-byte passphrase field.
55
- cmd = %w{ssh-keygen -f} + [File.expand_path('~/.ssh/id_rsa')] + %w{-b 768 -P} + ['']
55
+ cmd = %w{ssh-keygen -f} + [File.expand_path('~/.ssh/id_rsa')] + %w{-b 1024 -P} + ['']
56
56
  sh(*cmd)
57
57
  end
58
58
 
@@ -31,6 +31,7 @@ module PoiseBoiler
31
31
  require 'simplecov'
32
32
  require 'pry'
33
33
  require 'pry-byebug'
34
+ require 'chefspec'
34
35
 
35
36
  # Check for coverage stuffs
36
37
  formatters = []
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module PoiseBoiler
19
- VERSION = '1.15.0'
19
+ VERSION = '1.16.0'
20
20
  end
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  # Development gems
38
38
  spec.add_dependency 'bundler' # Used for Bundler.load_gemspec
39
- spec.add_dependency 'rake', '>= 10.4', '< 12.0'
39
+ spec.add_dependency 'rake', '>= 10.4', '< 13'
40
40
  spec.add_dependency 'travis', '~> 1.8', '>= 1.8.1'
41
41
  spec.add_dependency 'yard', '~> 0.8'
42
42
  spec.add_dependency 'yard-classmethods', '~> 1.0'
@@ -46,14 +46,19 @@ Gem::Specification.new do |spec|
46
46
  spec.add_dependency 'pry-byebug'
47
47
  spec.add_dependency 'git', '~> 1.2'
48
48
 
49
+ # IRB helper gems
50
+ spec.add_dependency 'wirb'
51
+ spec.add_dependency 'hirb'
52
+ spec.add_dependency 'awesome_print'
53
+
49
54
  # Test gems
50
55
  spec.add_dependency 'rspec', '~> 3.2'
51
56
  spec.add_dependency 'rspec-its', '~> 1.2'
52
- spec.add_dependency 'chefspec', '~> 5.0'
57
+ spec.add_dependency 'chefspec', '>= 5', '< 8' # Allow ChefSpec 5 for early 12.x.
53
58
  spec.add_dependency 'fuubar', '~> 2.0'
54
59
  spec.add_dependency 'simplecov', '~> 0.9'
55
60
  # Foodcritic 8.0 dropped support for Ruby 2.1, so it can't be used with olded Chef.
56
- spec.add_dependency 'foodcritic', '>= 7', '< 9'
61
+ spec.add_dependency 'foodcritic', '>= 7', '< 12'
57
62
 
58
63
  # Integration gems
59
64
  # https://github.com/test-kitchen/test-kitchen/issues/922
@@ -71,7 +76,7 @@ Gem::Specification.new do |spec|
71
76
  spec.add_dependency 'winrm-fs', '>= 0.4', '< 2'
72
77
 
73
78
  # Travis gems
74
- spec.add_dependency 'codeclimate-test-reporter', '~> 0.4'
79
+ spec.add_dependency 'codeclimate-test-reporter', '~> 1.0'
75
80
  spec.add_dependency 'codecov', '~> 0.0', '>= 0.0.2'
76
81
 
77
82
  # Development dependencies (yo dawg)
@@ -26,6 +26,8 @@ Gem::Specification.new do |s|
26
26
  s.authors = ['Alan Smithee']
27
27
  s.email = %{asmithee@example.com}
28
28
  s.homepage = 'https://github.com/example/example'
29
+ s.license = 'Apache-2.0'
30
+ s.metadata['platforms'] = 'ubuntu'
29
31
  end
30
32
  EOH
31
33
  file '.kitchen.yml', <<-EOH
@@ -42,14 +44,17 @@ suites:
42
44
  - name: default
43
45
  EOH
44
46
  file 'README.md'
47
+ file 'LICENSE'
45
48
 
46
49
  context 'no secure vars' do
47
50
  environment TRAVIS_SECURE_ENV_VARS: 'false'
48
51
 
49
- its(:stdout) { is_expected.to include 'Running task spec' }
50
- its(:stdout) { is_expected.to include 'Running task chef:foodcritic' }
51
- its(:stdout) { is_expected.to_not include 'Running task travis:integration' }
52
- its(:exitstatus) { is_expected.to eq 0 }
52
+ it do
53
+ expect(subject.stdout).to include 'Running task spec'
54
+ expect(subject.stdout).to include 'Running task chef:foodcritic'
55
+ expect(subject.stdout).to_not include 'Running task travis:integration'
56
+ expect(subject.exitstatus).to eq 0
57
+ end
53
58
  end # /context no secure vars
54
59
 
55
60
  context 'secure vars' do
@@ -111,10 +116,12 @@ UbWRwbhlKYyN9bgK47cxD7r39KRh3jAkiTcMlscquirkZTuyWj5INTn/g2ICIg5w
111
116
  -----END RSA PRIVATE KEY-----
112
117
  EOH
113
118
 
114
- its(:stdout) { is_expected.to include 'Running task spec' }
115
- its(:stdout) { is_expected.to include 'Running task chef:foodcritic' }
116
- its(:stdout) { is_expected.to include 'Running task travis:integration' }
117
- its(:exitstatus) { is_expected.to eq 0 }
119
+ it do
120
+ expect(subject.stdout).to include 'Running task spec'
121
+ expect(subject.stdout).to include 'Running task chef:foodcritic'
122
+ expect(subject.stdout).to include 'Running task travis:integration'
123
+ expect(subject.exitstatus).to eq 0
124
+ end
118
125
  end # /context secure vars
119
126
 
120
127
  context 'secure vars and Rackspace' do
@@ -138,9 +145,11 @@ EOH
138
145
  _environment['HOME'] = temp_path
139
146
  end
140
147
 
141
- its(:stdout) { is_expected.to include 'Running task spec' }
142
- its(:stdout) { is_expected.to include 'Running task chef:foodcritic' }
143
- its(:stdout) { is_expected.to include 'Running task travis:integration' }
144
- its(:exitstatus) { is_expected.to eq 0 }
148
+ it do
149
+ expect(subject.stdout).to include 'Running task spec'
150
+ expect(subject.stdout).to include 'Running task chef:foodcritic'
151
+ expect(subject.stdout).to include 'Running task travis:integration'
152
+ expect(subject.exitstatus).to eq 0
153
+ end
145
154
  end
146
155
  end
@@ -49,7 +49,7 @@ EOH
49
49
  command 'kitchen list'
50
50
  its(:stdout) do
51
51
  is_expected.to match(/default-ubuntu-1404\s+(Vagrant|Dummy)\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
52
- is_expected.to match(/default-ubuntu-1204\s+(Vagrant|Dummy)\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
52
+ is_expected.to match(/default-ubuntu-1604\s+(Vagrant|Dummy)\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
53
53
  is_expected.to match(/default-centos-6\s+(Vagrant|Dummy)\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
54
54
  is_expected.to match(/default-centos-7\s+(Vagrant|Dummy)\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
55
55
  end
@@ -72,7 +72,7 @@ EOH
72
72
  command 'kitchen list'
73
73
  its(:stdout) do
74
74
  is_expected.to_not match(/default-ubuntu-1404/)
75
- is_expected.to_not match(/default-ubuntu-1204/)
75
+ is_expected.to_not match(/default-ubuntu-1604/)
76
76
  is_expected.to match(/default-centos-6\s+(Vagrant|Dummy)\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
77
77
  is_expected.to match(/default-centos-7\s+(Vagrant|Dummy)\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
78
78
  end
@@ -123,7 +123,7 @@ EOH
123
123
  _environment['HOME'] = temp_path
124
124
  end
125
125
  its(:stdout) do
126
- is_expected.to match(/default-ubuntu-1204\s+Rackspace\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
126
+ is_expected.to match(/default-ubuntu-1404\s+Rackspace\s+PoiseSolo\s+(Busser\s+Sftp\s+)?<Not Created>/)
127
127
  end
128
128
  end # /context with kitchen-rackspace
129
129
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-boiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-09 00:00:00.000000000 Z
11
+ date: 2017-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '10.4'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '12.0'
36
+ version: '13'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '10.4'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '12.0'
46
+ version: '13'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: travis
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -168,6 +168,48 @@ dependencies:
168
168
  - - "~>"
169
169
  - !ruby/object:Gem::Version
170
170
  version: '1.2'
171
+ - !ruby/object:Gem::Dependency
172
+ name: wirb
173
+ requirement: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ type: :runtime
179
+ prerelease: false
180
+ version_requirements: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ - !ruby/object:Gem::Dependency
186
+ name: hirb
187
+ requirement: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ type: :runtime
193
+ prerelease: false
194
+ version_requirements: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
199
+ - !ruby/object:Gem::Dependency
200
+ name: awesome_print
201
+ requirement: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ type: :runtime
207
+ prerelease: false
208
+ version_requirements: !ruby/object:Gem::Requirement
209
+ requirements:
210
+ - - ">="
211
+ - !ruby/object:Gem::Version
212
+ version: '0'
171
213
  - !ruby/object:Gem::Dependency
172
214
  name: rspec
173
215
  requirement: !ruby/object:Gem::Requirement
@@ -200,16 +242,22 @@ dependencies:
200
242
  name: chefspec
201
243
  requirement: !ruby/object:Gem::Requirement
202
244
  requirements:
203
- - - "~>"
245
+ - - ">="
246
+ - !ruby/object:Gem::Version
247
+ version: '5'
248
+ - - "<"
204
249
  - !ruby/object:Gem::Version
205
- version: '5.0'
250
+ version: '8'
206
251
  type: :runtime
207
252
  prerelease: false
208
253
  version_requirements: !ruby/object:Gem::Requirement
209
254
  requirements:
210
- - - "~>"
255
+ - - ">="
211
256
  - !ruby/object:Gem::Version
212
- version: '5.0'
257
+ version: '5'
258
+ - - "<"
259
+ - !ruby/object:Gem::Version
260
+ version: '8'
213
261
  - !ruby/object:Gem::Dependency
214
262
  name: fuubar
215
263
  requirement: !ruby/object:Gem::Requirement
@@ -247,7 +295,7 @@ dependencies:
247
295
  version: '7'
248
296
  - - "<"
249
297
  - !ruby/object:Gem::Version
250
- version: '9'
298
+ version: '12'
251
299
  type: :runtime
252
300
  prerelease: false
253
301
  version_requirements: !ruby/object:Gem::Requirement
@@ -257,7 +305,7 @@ dependencies:
257
305
  version: '7'
258
306
  - - "<"
259
307
  - !ruby/object:Gem::Version
260
- version: '9'
308
+ version: '12'
261
309
  - !ruby/object:Gem::Dependency
262
310
  name: test-kitchen
263
311
  requirement: !ruby/object:Gem::Requirement
@@ -408,14 +456,14 @@ dependencies:
408
456
  requirements:
409
457
  - - "~>"
410
458
  - !ruby/object:Gem::Version
411
- version: '0.4'
459
+ version: '1.0'
412
460
  type: :runtime
413
461
  prerelease: false
414
462
  version_requirements: !ruby/object:Gem::Requirement
415
463
  requirements:
416
464
  - - "~>"
417
465
  - !ruby/object:Gem::Version
418
- version: '0.4'
466
+ version: '1.0'
419
467
  - !ruby/object:Gem::Dependency
420
468
  name: codecov
421
469
  requirement: !ruby/object:Gem::Requirement
@@ -478,7 +526,8 @@ files:
478
526
  - LICENSE
479
527
  - README.md
480
528
  - Rakefile
481
- - gemfiles/default.gemfile
529
+ - gemfiles/chef-12.gemfile
530
+ - gemfiles/chef-13.gemfile
482
531
  - gemfiles/master.gemfile
483
532
  - lib/kitchen/provisioner/poise_policyfile_zero.rb
484
533
  - lib/kitchen/provisioner/poise_solo.rb